I am unable to pass url in views html form action tag.
<form method="post" action="??what to write here??" accept-charset="UTF-8">
I want to set it's action to WelcomeController@log_in
function in WelcomeController
file in controllers.
Here are my routes:
Route::get('/','WelcomeController@home');
Route::post('/', array('as' => 'log_in', 'uses' => 'WelcomeController@log_in'));
Route::get('home', 'HomeController@index');
After submitting it keeps the same url
http://localhost:8000/
And the main error line
Whoops, looks like something went wrong.
After that there is 1/1 TokenMismatchException in compiled.php line 2440:
if you want to call controller from form action that time used following code:
Here
SchoolController
is a controller name andgetSchool
is a method name, you must useget
orpost
before method name which should be same as in form tag.Your form is also missing '{{csrf_field()}}'
You need to set a name to your Routes. Like this:
I just put name on Routes that need this. In my case, to call from tag form at blade template. Like this:
Or, You can do this: