|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Tag;
|
|
|
|
|
use App\Http\Resources\TagCollection;
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
|
|
class TagController extends Controller
|
|
|
|
@ -14,7 +15,7 @@ class TagController extends Controller
|
|
|
|
|
*/
|
|
|
|
|
public function index()
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
return TagCollection(Tag::get());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -24,40 +25,34 @@ class TagController extends Controller
|
|
|
|
|
*/
|
|
|
|
|
public function create()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return view("create_tag");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Store a newly created resource in storage.
|
|
|
|
|
*
|
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
|
*/
|
|
|
|
|
public function store(Request $request)
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Display the specified resource.
|
|
|
|
|
* Show the form for editing the specified resource.
|
|
|
|
|
*
|
|
|
|
|
* @param \App\Tag $tag
|
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
|
*/
|
|
|
|
|
public function show(Tag $tag)
|
|
|
|
|
public function edit(Tag $tag)
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
return view("edit_tag");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Show the form for editing the specified resource.
|
|
|
|
|
* Store a newly created resource in storage.
|
|
|
|
|
*
|
|
|
|
|
* @param \App\Tag $tag
|
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
|
*/
|
|
|
|
|
public function edit(Tag $tag)
|
|
|
|
|
public function store(Request $request)
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
$tag = new Tag;
|
|
|
|
|
|
|
|
|
|
$tag->tag_text = $request->tag_text;
|
|
|
|
|
$tag->creator_id = $request->user_id;
|
|
|
|
|
|
|
|
|
|
$tag->save();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -69,7 +64,8 @@ class TagController extends Controller
|
|
|
|
|
*/
|
|
|
|
|
public function update(Request $request, Tag $tag)
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
$tag->tag_text = $request->tag_text;
|
|
|
|
|
$tag->save();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -80,6 +76,6 @@ class TagController extends Controller
|
|
|
|
|
*/
|
|
|
|
|
public function destroy(Tag $tag)
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
$tag->delete();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|