FEATURE: prepare handlers for categories
This commit is contained in:
@@ -3,9 +3,8 @@ namespace App\Handlers\Contracts;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Content;
|
||||
use App\Models\User;
|
||||
|
||||
interface AppHandler
|
||||
interface AppHandler extends BaseModuleHandler
|
||||
{
|
||||
/**
|
||||
* Render given module into visitor area.
|
||||
@@ -21,13 +20,13 @@ interface AppHandler
|
||||
|
||||
/**
|
||||
* Load some extra data for content management form?
|
||||
*
|
||||
*
|
||||
* @param Content $content
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function loadExtraData(Content $content);
|
||||
|
||||
|
||||
/**
|
||||
* Save module-specific values into database
|
||||
*
|
||||
@@ -55,23 +54,14 @@ interface AppHandler
|
||||
|
||||
/**
|
||||
* Method called right after content page is marked as deleted
|
||||
*
|
||||
*
|
||||
* This method is supposed to clean after "deleted" page.
|
||||
*
|
||||
*
|
||||
* @param Content $content
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function delete(Content $content);
|
||||
|
||||
/**
|
||||
* Does given module manage content? Or is it just module with widgets/something internal/something absolutely else?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function managesContent();
|
||||
|
||||
public static function getModuleId();
|
||||
|
||||
/**
|
||||
* Getter for section names in creating/editing content resource
|
||||
@@ -99,19 +89,9 @@ interface AppHandler
|
||||
public static function getExtendedFormInputsEdit();
|
||||
|
||||
/**
|
||||
* Register admin menu (or multiple ones)
|
||||
* Does this module support categories?
|
||||
*
|
||||
* 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
|
||||
* @return boolean
|
||||
*/
|
||||
public static function registerAdminMenu(User $user);
|
||||
|
||||
/**
|
||||
* Install module
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function install();
|
||||
public static function supportCategories();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace App\Handlers\Contracts;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
interface BaseModuleHandler
|
||||
{
|
||||
public static function getModuleId();
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* Install module
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function install();
|
||||
}
|
||||
Reference in New Issue
Block a user