I have some error which I dont how to fix. The error is InvalidArgumentException in FileViewFinder.php line 137: View [contacts.create] not found.
I have a html form which I want when i fill it with some informations to store them on database.
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>Contact us!</h1>
<hr>
{!! Form::open(array('route' => 'contacts.store')) !!}
{!! Form::close() !!}
</div>
</div>
This is my controller with functions for this page.
public function create()
{
return view('contacts.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->validate($request, array(
'title' => 'required|max:255',
'body' => 'required'
));
$contact = new Contact;
$contact->title = $request->title;
$contact->body = $request->body;
$contact->save();
// return redirect()->route('', $contact->id);
return view('home');
}
Also when i type in cmd php artisan route:list it gave me all the views that I create using migrate function.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire