here i create a form in Laravel to post request through route "posts.store" to the controller "PostsController"
{!! Form::open(['url' => 'posts.store']) !!}
{!! Form::close() !!}
This is the "PostsController" where i am trying to access my request which throughs an error:
public function store(Request $request)
{
//validate data
$this-> validate($request, array(
'title' => 'required|max:255',
'body' => 'required'
));
//Store data into database
$post = new Post;
$post->title = $request->title;
$post->body = $request->body;
$post->save();
return redirect()->route('posts.show', $post->id);
}
when i submit the form the following page is appearing (1/1) NotFoundHttpException
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2suxHPy
via IFTTT
Aucun commentaire:
Enregistrer un commentaire