I am really confused. When I return just "ok" from my controller store function, it is returning "ok" but When I'm going to store the request, it is not working. It is returning the same page. Here is my form:
<form role="form" action="" method="post" enctype="multipart/form-data">
<input type="text" name="title" id="title" value="" class="form-control">
<textarea id="mytextarea" name="mytextarea" class="form-control"></textarea>
Here is my Controller:
public function store(Request $request)
{
// return "ok";
$this->validate($request,[
'title'=>'required',
]);
$idea = new Idea;
$idea->title = $request->title;
$idea->content = $request->mytextarea;
$idea->save();
return redirect(route('idea.index'))->with('message','Post has been Created successfully');
}
Here is my Route:
Route::resource('idea','User\IdeaController');
NB: I'm using TinyMCE editor for textarea
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire