I'm having troubles to just redirect to a url from a controller.
This is my trigger:
<form method="POST" action="{{ url('creategroup") }}">
Then, this is the catcher:
Route::post('/creategroup', 'GroupController@store');
And finally, this is my method:
public function store(Request $request) {
/* bla bla bla */
return Redirect::to('/users/'.$request->id.'/groups/');
}
But it doesn't work, the url just stops in localhost/creategroup and it shows a page that say that the page has expired, and it doesn't redirect to any place. Help please.
Looks like a problem with csrfToken.
Have you added the field on the form?
{!! csrf_field() !!}
Learn more here
This could happen due to the first backslash, try following:
return redirect('users/'.$request->id.'/groups');