Feb 7, 2017
0
Level 2
Session flash not working in Laravel 5.2.45
Similar issue regarding Session flash not working. Was suggested to another to post a new post for help.
Doesn't seem to be working with either 'web' in routes or not. Had removed, added back, same issue:
$ php artisan --version
Laravel Framework version 5.2.45
From route list:
$ php artisan route:list
...
| | GET|HEAD | dashboard | dashboard.index | Project\Http\Controllers\DashboardController@index | web,auth |
routes.php
Route::group(['middleware' => ['web', 'auth',],], function () {
Route::resource('dashboard', 'DashboardController');
...
Have been running the follow after changes to routes and .env:
php artisan clear-compiled
php artisan config:clear
php artisan config:cache
composer dump-auto
Kernel.php
<?php namespace Project\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel {
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\Project\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\Project\Http\Middleware\VerifyCsrfToken::class,
],
'api' => [
'throttle:60,1',
],
];
/**
* The application's global HTTP middleware stack.
*
* @var array
*/
protected $middleware = [
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Project\Http\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
'Illuminate\View\Middleware\ShareErrorsFromSession',
'Project\Http\Middleware\VerifyCsrfToken',
];
/**
* The application's route middleware.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => 'Project\Http\Middleware\Authenticate',
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
'guest' => 'Project\Http\Middleware\RedirectIfAuthenticated',
'cors' => 'Project\Http\Middleware\Cors',
];
}
BTW, my RouteServiceProvider is still using older method:
public function map(Router $router) {
$router->group(['namespace' => $this->namespace], function ($router) {
require app_path('Http/routes.php');
});
}
so 'web' is not being applied twice.
Please or to participate in this conversation.