पेज · Laravilt
Structure
The directory layout and naming conventions of a generated plugin.
A plugin generated with php artisan laravilt:plugin BlogManager --vendor=laravilt looks like this (optional folders only appear if you pick the feature):
text
Components you generate later with laravilt:make add folders such as src/Models, src/Resources, src/Http/Controllers, database/factories and database/seeders.
Key files
| File | Purpose |
|---|---|
src/{Name}Plugin.php | Plugin class that registers resources, pages and widgets on a panel |
src/{Name}ServiceProvider.php | Laravel service provider: merges config, loads translations, migrations, views and routes, registers commands |
src/Commands/Install*Command.php | Install command for the plugin |
config/*.php | Plugin configuration |
The generated plugin class may import
Filament\Contracts\PluginandFilament\Panel. Laravilt plugins should extendLaravilt\Plugins\PluginProviderand type-hintLaravilt\Panel\Panel, so update those imports if you see them.
Naming conventions
| Item | Convention | Example |
|---|---|---|
| Plugin ID | kebab-case | blog-manager |
| Class name | StudlyCase | BlogManagerPlugin |
| Namespace | Vendor\PluginName | Laravilt\BlogManager |
| Directory | packages/{vendor}/{kebab-name} | packages/laravilt/blog-manager |