FEATURE #1401: add middleware for registering modules

This commit is contained in:
Michal Kváček
2016-01-29 11:59:57 +01:00
parent ee55715093
commit a880ab9e15
4 changed files with 70 additions and 2 deletions
+35 -2
View File
@@ -1,6 +1,39 @@
<?php
namespace App\Handlers;
abstract class Handler {
abstract public function render();
use App\Models\Content;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
/**
* Class Handler
*
* Handler is a class which handles module-specific behaviour which cannot be done by module itself, resp. cannot be done by some abstract magic.
*
* @package App\Handlers
*/
abstract class Handler
{
/**
* Render given module into visitor area.
*
* @param Content $content DB model from table contents
* @param array $parameters parameters used for modifications/custom settings of given model
*
* @return mixed
*/
abstract public function render(Content $content, $parameters);
/**
* Register admin menu (or multiple ones)
*
* This cannot be in ServiceProvider because Session is started at middleware. And ServiceProvider is called before
* starting any middleware..
*
* @param User $user model of logged user
*/
public static function registerAdminMenu(User $user)
{
//
}
}