Support the ongoing development of Laravel.io →
Authentication Input Session
Last updated 2 years ago.
0
  1. You have that email / password combo in the database?

  2. dd(Input::all()); at the beginning of your store method to verify what you are getting from the form.

Last updated 2 years ago.
0
  1. I have that combo in the database and the password is hashed with Hash::make();

  2. 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.

Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

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
}
Last updated 2 years ago.
0

paste your routes file code

Last updated 2 years ago.
0

try this in your form :

{{Form::open(array('url' => '/', 'class' => 'login', 'method' => 'POST'))}}

Last updated 2 years ago.
0

Tried that. Still not working :(. It acts like the form isn't submitted at all, it just refreshes the website.

Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

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());
}
Last updated 2 years ago.
0

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"

Last updated 2 years ago.
0

I don't think it even redirects me to the SessionsController@store, don't know why though.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.