Autenticação do Laravel 5.2 não está funcionando
Como vocês sabem, o Laravel 5.2 foi lançado há alguns dias atrás. Estou tentando esta nova versão. Eu fiz um novo projeto usando o seguinte comando na CLI:
laravel new testapp
Conformedocumentação do Início rápido da autenticação, Segui o seguinte comando para encaminhar rotas e visualizações de autenticação:
php artisan make:auth
Funcionou bem. O registro está funcionando bem. Mas estou enfrentando problemas no login. Após o login, testei a seguir no arquivo route.php:
Route::get('/', function () {
dd( Auth::user());
return view('welcome');
});
Auth::user()
está voltandonull
e tambémAuth::check()
eAuth::guest()
não estão funcionando adequadamente. Tentei a mesma coisa várias vezes três vezes, criando novos projetos, mas não consegui os resultados corretos.
Abaixo está o completoroute.php
<?php
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
dd( Auth::());
return view('welcome');
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
//
});
Route::group(['middleware' => 'web'], function () {
Route::auth();
Route::get('/home', 'HomeController@index');
});
Alguém pode me ajudar? ou Alguém está enfrentando o mesmo problema? Como posso corrigir isso?