php - Enabling Middleware in Lumen (Laravel) -
i've been trying out lumen (a micro php framework based on laravel 5) few hours , i'm not able add middlewares project means i'm not able use features sessions or csrf protection.
my .env looks this:
app_env=local app_debug=true app_key=some32charslongkey app_locale=en app_fallback_locale=en db_connection=mysql db_host=localhost db_database=somedbname db_username=someusername db_password=somepw queue_driver=database cache_driver=memcached session_driver=memcached
and bootstrap/app.php this:
require_once __dir__.'/../vendor/autoload.php'; dotenv::load(__dir__.'/../'); $app = new laravel\lumen\application( realpath(__dir__.'/../') ); $app->withfacades(); $app->witheloquent(); $app->singleton( 'illuminate\contracts\debug\exceptionhandler', 'app\exceptions\handler' ); $app->singleton( 'illuminate\contracts\console\kernel', 'app\console\kernel' ); $app->middleware([ // 'illuminate\cookie\middleware\encryptcookies', // 'illuminate\cookie\middleware\addqueuedcookiestoresponse', // 'illuminate\session\middleware\startsession', // 'illuminate\view\middleware\shareerrorsfromsession', // 'laravel\lumen\http\middleware\verifycsrftoken', ]); require __dir__.'/../app/http/routes.php'; return $app;
as uncomment lines within $app->middleware([ ... ]); app doesn't show on of routes. i'm new configuration .env , maybe forgot add can't seem solve problem.
as you've enabled session middleware lumen trying use memcached have set in .env file if change on file should work then.
Comments
Post a Comment