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

Hmm.. you are only allowed to have one controller per route in your routes.php .

You can set your RESTful controller to a new route to reference

For example:

<?php
   //route to get the log in form
   Route::get('/', array('uses' => 'HomeController@showLogIn'));

   //route to process the log in form
   Route::post('/login', ['uses' => 'LogInController@doLogIn', 'as' => 'login.form']);
   Route::controller('/login', 'LogInController');

Then in your view change your Form::open to:

{{  Form::open([route'=>'login.form', 'method' => 'post')] }} 
Last updated 1 year ago.
0

its now showing the error 'something went wrong'

Last updated 1 year ago.
0

it is working ,i think my validation code has a problem. I commented it out and commanted to direct the user to the laravel welcome page and it worked

Last updated 1 year ago.
0

here is where I changed

  //route to process the log in form
  Route::post('/controller', array('uses' => 'HomeController@doLogIn'));

I edited the doLogIn function to

public function doLogIn()
   {
         return View::make('hello');
    }  
Last updated 1 year ago.
0

andyblem said:

its now showing the error 'something went wrong'

Go to the file 'app.php' and set debug to true to give yourself a helping hand in the future.

Last updated 1 year ago.
0

okay, thanks

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

andyblem andyblem Joined 7 Nov 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.