You have that email / password combo in the database?
dd(Input::all());
at the beginning of your store method to verify what you are getting from the form.
I have that combo in the database and the password is hashed with Hash::make();
dd(Input::all()); wont display anything :S
Could it be that the view in which the form is contained in is called by the index function of another controller that is:
my PagesController@index returns the view with the forms, the form submits to SessionsController@create where it's processed.
Your form submits to 'action' => 'SessionsController@store'
so if you dd() there and get no Input::all()
var_dump, then something else is wrong.
What are your routes like?
Could it be that my header.blade.php file contains that form, and the header file is included into the home.blade.php file with @include ?
The home.blade.php file is called by the PagesController@index while the login is processed by SessionsController@create. I don't think that could be an issue but I honestly don't know right now.
<?php
#csrf Protection
Route::when('*', 'csrf', ['post', 'put', 'patch']);
#Home
Route::get('/', ['as' => 'home', 'uses' => 'PagesController@index']);
#MAIN
#Registration
Route::get('/register', 'RegistrationController@create')->before('guest');
Route::post('/register', 'RegistrationController@store');
#Account
Route::get('/account/activate/{code}', array('as' => 'account-activate', 'uses' => 'RegistrationController@getActivate'));
#Login
Route::post('/', 'SessionsController@store');
#END MAIN
#ADMIN
#Banners
Route::get('/admin/clients/banners', 'BannersController@index');
Route::post('/admin/clients/banners/create', 'BannersController@create');
Route::resource('/admin/clients/banners', 'BannersController', ['only' => ['create', 'store', 'destroy']]);
Route::post('/admin/cgalleries/{id}/edit', 'CgalleriesController@addPictures');
#Place Images
Route::post('/admin/places/{place}/edit', 'GalleriesController@store');
#Resources
Route::group(array('prefix' => 'admin'), function()
{
Route::resource('clients', 'ClientsController');
Route::resource('streams', 'StreamsController');
Route::resource('places', 'PlacesController');
Route::resource('articles', 'ArticlesController');
Route::resource('cgalleries', 'CgalleriesController');
Route::resource('announcements', 'AnnouncementsController');
});
#END ADMIN
}
try this in your form :
{{Form::open(array('url' => '/', 'class' => 'login', 'method' => 'POST'))}}
Tried that. Still not working :(. It acts like the form isn't submitted at all, it just refreshes the website.
SelimSalihovic said:
Tried that. Still not working :(. It acts like the form isn't submitted at all, it just refreshes the website.
Does it even redirect you to SessionsController@store?
I usually do it like this:
##Routes
Route::get("/login", array( "as" => "login" , "uses" => "UserController@login");
## View
<form action="{{ URL::route('login') }}" method="post">
<input ......... >
<input ......... >
</form>
## Controller
public function login(){
dd(Input::all());
}
you need to have a table users with fields : email and password hashed, and then try to enter this email, and password and submit then you will get "success"
I don't think it even redirects me to the SessionsController@store, don't know why though.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community