Support the ongoing development of Laravel.io →
posted 9 years ago
Forms
Last updated 2 years ago.
0

It's better if you show your codes for route, controller and views.

0

Here is the code

Route::post('products/search', ['as' => 'search', 'uses' => 'ProductController@search']); Route::controller('products', 'ProductController');

{!! Form::open(['route' => 'search', 'class' => 'form', 'method' => 'post']) !!} {!! Form::text('search') !!} {!! Form::select('ts1', $data1) !!} {!! Form::select('ts2', $data2) !!} {!! Form::select('ts3', $data3) !!} {!! Form::submit('Search', array('class'=>'btn btn-primary')) !!} {!! Form::close() !!}

TokenMismatchException in VerifyCsrfToken.php line 46: in VerifyCsrfToken.php line 46 at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17 at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 125 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in ShareErrorsFromSession.php line 55 at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 125 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in StartSession.php line 62 at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 125 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 125 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in EncryptCookies.php line 40 at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 125 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in CheckForMaintenanceMode.php line 42 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 125 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101 at Pipeline->then(object(Closure)) in Kernel.php line 108 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 83 at Kernel->handle(object(Request)) in index.php line 53

0
Solution

Had to add use Illuminate\Support\Facades\Session; in my controller

0

@frocco - i get those errors, in which controller add this "use Illuminate\Support\Facades\Session;" ?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

frocco frocco Joined 3 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.