FEATURE: move widget and template dir installation into middleware, optimize middleware groups
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Handlers\Registrators\WidgetRegistrator;
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
class WidgetInstaller
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
/**
|
||||
* @var $registator WidgetRegistrator
|
||||
*/
|
||||
$registator = App::make('registerWidget');
|
||||
|
||||
// install registered widgets
|
||||
$registator->installWidgets();
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user