How to refresh a page in laravel after saving data?
After saving data to database i want to refresh the page. How to do this in laravel controller?
You can use a redirect on current path with something like this :
redirect(Request::url())
Not sure it is totally correct but something like this will reload page normally !
I tried the following code.. But not working
public function store()
{
$validator = Validator::make(Input::all(), array(
'name'=>'required'
));
if($validator->passes()){
states::savestate(Input::except(array('_token')));
}
return Redirect::back()->with('message','Operation Successful !');
}
Sorry I updated my answer, but if it doesn't work you might try to use something like :
return view('/wantedView')
i tried that also.,not working
I don't have any other ideas, I'm new to Laravel too so I'm sorry :D
have u got any errors;
here is two option if u want redirect back
then use
return back();
and other is that if want another page then use route like
return redirect()->to('/route');
Hey Vipin93 Thanks man it work for me :)
Please or to participate in this conversation.