How to integrate CKFinder with Laravel 5.2? -


since laravel 5.2 shares it's session routes enclosed in "web" middleware group, no more can run auth::check() in ckfinder config. know how solve this?

update: used share laravel's 5 session ckfinder in order give access permissions authorized users. this:

require __dir__.'/../../bootstrap/autoload.php'; $app = require_once __dir__.'/../../bootstrap/app.php'; $app->make('illuminate\contracts\http\kernel') ->handle(illuminate\http\request::capture());  function checkauthentication() {         return auth::check() && auth()->user()->isadmin(); } 

but since routes should wrapped in group 'web' middleware, routes outside group wouldn't let use auth::user()

route::group(['middleware' => 'web'], function () { }); 

how put ckfinder routes 'web' middleware able use laravel's session?

very easy. modify kernel.php

 protected $middleware = [     \illuminate\foundation\http\middleware\checkformaintenancemode::class,     \illuminate\session\middleware\startsession::class, ];  protected $middlewaregroups = [     'web' => [         \app\http\middleware\encryptcookies::class,         \illuminate\cookie\middleware\addqueuedcookiestoresponse::class,         \illuminate\view\middleware\shareerrorsfromsession::class,         \app\http\middleware\verifycsrftoken::class,     ],      'api' => [         'throttle:60,1',     ], ]; 

then try again。


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -