39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
namespace App\Handlers;
|
|
|
|
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)
|
|
{
|
|
//
|
|
}
|
|
} |