Files
laravel-manager/src/Modules/BaseModule.php
T
Matthijs Iriks 6f4d9b44f2
PR CI / flow (pull_request) Successful in 4s
PR CI / ledger (pull_request) Successful in 3s
PR CI / test (stable) (pull_request) Successful in 38s
PR CI / test (lowest) (pull_request) Successful in 44s
PR CI / security (pull_request) Successful in 51s
PR CI / pr-ci (pull_request) Successful in 1s
PR CI / release-automerge (pull_request) Successful in 3s
Add manager:install, manager:doctor and an integration guide for AI agents
2026-12-04 03:44:10 +01:00

87 lines
1.6 KiB
PHP

<?php
namespace IriksIT\Manager\Modules;
use IriksIT\Manager\Contracts\Module;
/**
* Convention over configuration: a module `Foo` lives in src/Modules/Foo, with
* routes.php and a migrations/ folder next to its class when it needs them.
*/
abstract class BaseModule implements Module
{
public function enabledByDefault(): bool
{
return false;
}
public function requires(): array
{
return [];
}
public function permissions(): array
{
return [];
}
public function navigation(): array
{
return [];
}
public function routes(): ?string
{
return $this->path('routes.php');
}
public function publicRoutes(): ?string
{
return $this->path('public-routes.php');
}
public function commands(): array
{
return [];
}
/**
* Tables (without the prefix) this module needs; `manager:doctor` checks that they exist.
*
* @return list<string>
*/
public function tables(): array
{
return [];
}
public function actions(): array
{
return [];
}
public function views(): array
{
return [];
}
public function middleware(): array
{
return [];
}
public function boot(): void {}
public function migrations(): ?string
{
return $this->path('migrations');
}
private function path(string $name): ?string
{
$path = dirname((new \ReflectionClass($this))->getFileName()).'/'.$name;
return file_exists($path) ? $path : null;
}
}