'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@cleanSubcats', 'admin/cats/placeholderforsearch' => 'Visiosoft\CatsModule\Http\Controller\Admin\PlaceholderforsearchController@index', 'admin/cats/placeholderforsearch/create' => 'Visiosoft\CatsModule\Http\Controller\Admin\PlaceholderforsearchController@create', 'admin/cats/placeholderforsearch/edit/{id}' => 'Visiosoft\CatsModule\Http\Controller\Admin\PlaceholderforsearchController@edit', 'admin/cats' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@index', 'admin/cats/create' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@create', 'admin/cats/edit/{id}' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@edit', 'admin/cats/category/delete/{id}' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@delete', ]; /** * The addon middleware. * * @type array|null */ protected $middleware = [ //Visiosoft\CatsModule\Http\Middleware\ExampleMiddleware::class ]; /** * Addon group middleware. * * @var array */ protected $groupMiddleware = [ //'web' => [ // Visiosoft\CatsModule\Http\Middleware\ExampleMiddleware::class, //], ]; /** * Addon route middleware. * * @type array|null */ protected $routeMiddleware = []; /** * The addon event listeners. * * @type array|null */ protected $listeners = [ //Visiosoft\CatsModule\Event\ExampleEvent::class => [ // Visiosoft\CatsModule\Listener\ExampleListener::class, //], ]; /** * The addon alias bindings. * * @type array|null */ protected $aliases = [ //'Example' => Visiosoft\CatsModule\Example::class ]; /** * The addon class bindings. * * @type array|null */ protected $bindings = [ CatsPlaceholderforsearchEntryModel::class => PlaceholderforsearchModel::class, CatsCategoryEntryModel::class => CategoryModel::class, ]; /** * The addon singleton bindings. * * @type array|null */ protected $singletons = [ PlaceholderforsearchRepositoryInterface::class => PlaceholderforsearchRepository::class, CategoryRepositoryInterface::class => CategoryRepository::class, ]; /** * Additional service providers. * * @type array|null */ protected $providers = [ //\ExamplePackage\Provider\ExampleProvider::class ]; /** * The addon view overrides. * * @type array|null */ protected $overrides = [ //'streams::errors/404' => 'module::errors/404', //'streams::errors/500' => 'module::errors/500', ]; /** * The addon mobile-only view overrides. * * @type array|null */ protected $mobile = [ //'streams::errors/404' => 'module::mobile/errors/404', //'streams::errors/500' => 'module::mobile/errors/500', ]; /** * Register the addon. */ public function register() { // Run extra pre-boot registration logic here. // Use method injection or commands to bring in services. } /** * Boot the addon. */ public function boot() { // Run extra post-boot registration logic here. // Use method injection or commands to bring in services. } /** * Map additional addon routes. * * @param Router $router */ public function map(Router $router) { // Register dynamic routes here for example. // Use method injection or commands to bring in services. } public function getOverrides() { $request = app('Illuminate\Http\Request'); $view = $request->get('view'); if ($request->segment(2) === $this->addon->getSlug() && $view !== 'table' and $request->path() == "admin/cats") { $sections = [ 'category' => [ 'buttons' => [ 'new_category' => [ 'href' => '/admin/cats/create?parent='.$request->cat ], ], ], 'placeholderforsearch' => [ 'buttons' => [ 'new_placeholderforsearch', ], ], ]; $this->addon->setSections($sections); } return parent::getOverrides(); } }