php - I am getting an "Route not defined error" with my form in Laravel -
i have set form this:
<!--registration form--> {{ form::open(array('action' => 'logincontroller@try_login', 'class'=>'login_form', 'id'=>'login_reg_form', 'role' => 'form')) }} {{ form::label('email', 'email address', array('class' => 'email')); }} {{ form::text('email', 'example@gmail.com', array('class' => 'form-control')) }} {{ form::label('password', 'password', array('class' => 'password')); }} {{ form::password('password', array('class' => 'form-control')) }} {{ form::submit('click me!'); }} {{ form::close() }} <!--end form-->
pointing login controller.
here controller code:
class logincontroller extends basecontroller { /** * instantiate new logincontroller instance. */ public function __construct() { } /** * try_login */ public function try_login() { //do authentication - log user in. } }
all seems well, reason following error:
errorexception (e_unknown) route [homecontroller@try_login] not defined. (view: /users/tapha/../login.blade.php)
in routes.php
, have define route form can access or never know when submit form. defining controller@method
not suffice.
i assume you're sending form get
because otherwise would've provided 'method' => 'post'
in form creation code.
route::get('login', ['uses' => 'homecontroller@try_login']);
Comments
Post a Comment