Back end controllers done? Find out on the next episode of dragon ball z

pull/1/head
Braydon Kains 6 years ago
parent f440039cf2
commit 3b1ef512b4

@ -29,6 +29,17 @@ class PostController extends Controller
return view("create_post")->withThread($thread);
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Post $post
* @return \Illuminate\Http\Response
*/
public function edit(Post $post)
{
return view("edit_post")->withPost($post);
}
/**
* Store a newly created resource in storage.
*
@ -46,17 +57,6 @@ class PostController extends Controller
$post->save();
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Post $post
* @return \Illuminate\Http\Response
*/
public function edit(Post $post)
{
return view("edit_post")->withPost($post);
}
/**
* Update the specified resource in storage.
*
@ -79,6 +79,6 @@ class PostController extends Controller
*/
public function destroy(Post $post)
{
//
$post->delete();
}
}

@ -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();
}
}

@ -29,6 +29,17 @@ class ThreadController extends Controller
return view("create_thread");
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Thread $thread
* @return \Illuminate\Http\Response
*/
public function edit(Thread $thread)
{
return view("edit")->withThread($thread);
}
/**
* Store a newly created resource in storage.
*
@ -58,17 +69,6 @@ class ThreadController extends Controller
return view("thread_view")->withThread($thread);
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Thread $thread
* @return \Illuminate\Http\Response
*/
public function edit(Thread $thread)
{
return view("edit")->withThread($thread);
}
/**
* Update the specified resource in storage.
*
@ -90,6 +90,6 @@ class ThreadController extends Controller
*/
public function destroy(Thread $thread)
{
//
$thread->delete();
}
}

@ -18,4 +18,4 @@ class TagCollection extends ResourceCollection
"data" => $this->$collection
];
}
}
}
Loading…
Cancel
Save