{"id":36335169,"url":"https://github.com/paramientos/laravel-plugin-system","last_synced_at":"2026-01-11T12:05:16.470Z","repository":{"id":318152462,"uuid":"1070202721","full_name":"paramientos/laravel-plugin-system","owner":"paramientos","description":"An extensive Laravel plugin system that provides automatic registration of routes, controllers, services, views, and configurations for modular application development.","archived":false,"fork":false,"pushed_at":"2025-10-09T21:16:29.000Z","size":137,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-27T16:32:38.843Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paramientos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-05T13:31:32.000Z","updated_at":"2025-10-09T21:15:47.000Z","dependencies_parsed_at":"2025-10-05T14:14:44.548Z","dependency_job_id":null,"html_url":"https://github.com/paramientos/laravel-plugin-system","commit_stats":null,"previous_names":["paramientos/laravel-plugin-system"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/paramientos/laravel-plugin-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramientos%2Flaravel-plugin-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramientos%2Flaravel-plugin-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramientos%2Flaravel-plugin-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramientos%2Flaravel-plugin-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paramientos","download_url":"https://codeload.github.com/paramientos/laravel-plugin-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramientos%2Flaravel-plugin-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28302278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-11T12:05:16.020Z","updated_at":"2026-01-11T12:05:16.464Z","avatar_url":"https://github.com/paramientos.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Plugin System\n\nAn extensive Laravel plugin system that provides automatic registration of routes, controllers, services, views, and configurations for modular application development.\n\n## Features\n\n-  **Automatic Plugin Discovery** - Automatically scans and registers plugins\n- ️ **Route Registration** - Auto-registers plugin routes with customizable prefixes\n-  **Controller Binding** - Automatically binds plugin controllers to the service container\n-  **Service Registration** - Registers services as singletons with interface binding support\n-  **View Integration** - Seamless integration with Laravel views and Livewire Volt\n- ️ **Config Management** - Automatic configuration loading and merging\n-  **Plugin Generator** - Artisan command to create new plugins with boilerplate code\n-  **Component Generator** - Create commands, controllers, listeners, events, and views within plugins (v1.5)\n-  **Component Management** - Add components to existing plugins with duplicate detection (v1.5)\n\n## Installation\n\nInstall the package via Composer:\n\n```bash\ncomposer require soysaltan/laravel-plugin-system\n```\n\nPublish the configuration file:\n\n```bash\nphp artisan vendor:publish --tag=laravel-plugin-system-config\n```\n\n## Key Features (v1.5)\n\n### Smart Plugin Management\n- **Existing Plugin Detection**: Automatically detects if a plugin already exists\n- **Component Addition**: Add new components to existing plugins without recreation\n- **Duplicate Prevention**: Warns and skips if component already exists\n- **Flexible Component Creation**: Create individual or multiple components at once\n\n### Supported Components\n- **Commands**: Custom Artisan commands with proper signatures\n- **Controllers**: RESTful controllers with CRUD operations (extends Laravel Controller)\n- **Events**: Broadcastable events with proper structure\n- **Listeners**: Queue-enabled listeners with error handling\n- **Views**: Blade templates or Livewire Volt components\n- **Routes**: RESTful route definitions with proper namespacing (v1.5)\n- **Enums**: PHP 8.1+ enums with string backing type\n- **Traits**: Reusable trait classes (concerns) for shared functionality\n- **Providers**: Service providers automatically created for each plugin\n\n## Configuration\n\nThe configuration file `config/laravel-plugin-system.php` allows you to customize:\n\n```php\nreturn [\n    // Path where plugins are stored\n    'plugins_path' =\u003e app_path('Plugins'),\n    \n    // Base namespace for plugins\n    'plugin_namespace' =\u003e 'App\\\\Plugins',\n    \n    // Whether to prefix routes with 'plugins/'\n    'use_plugins_prefix_in_routes' =\u003e false,\n    \n    // Default view type for new plugins\n    'default_view_type' =\u003e 'volt', // 'volt' or 'blade'\n    \n    // Enable/disable Volt support\n    'enable_volt_support' =\u003e true,\n];\n```\n\n## Usage\n\n### Creating a Plugin\n\nUse the Artisan command to create a new plugin:\n\n```bash\n# Create plugin with default view type (configured in config)\nphp artisan make:plugin MyAwesomePlugin\n\n# Create plugin with Volt views\nphp artisan make:plugin MyAwesomePlugin --view-type=volt\n\n# Create plugin with traditional Blade views\nphp artisan make:plugin MyAwesomePlugin --view-type=blade\n\n# Auto-detect best view type based on configuration and availability\nphp artisan make:plugin MyAwesomePlugin --view-type=auto\n```\n\n### Creating Plugin Components (v1.5)\n\nGenerate specific components within your plugin:\n\n```bash\n# Create a command within the plugin\nphp artisan make:plugin MyAwesomePlugin --command=ProcessDataCommand\n\n# Create a controller within the plugin\nphp artisan make:plugin MyAwesomePlugin --controller=ApiController\n\n# Create an event within the plugin\nphp artisan make:plugin MyAwesomePlugin --event=DataProcessedEvent\n\n# Create a listener within the plugin\nphp artisan make:plugin MyAwesomePlugin --listener=SendNotificationListener\n\n# Create a view within the plugin\nphp artisan make:plugin MyAwesomePlugin --view=dashboard\n\n# Create routes for the plugin (v1.5)\nphp artisan make:plugin MyAwesomePlugin --route\n\n# Create an enum within the plugin\nphp artisan make:plugin MyAwesomePlugin --enum=Status\n\n# Create a trait within the plugin\nphp artisan make:plugin MyAwesomePlugin --trait=Cacheable\n\n# Combine multiple components\nphp artisan make:plugin MyAwesomePlugin --command=ProcessCommand --controller=ProcessController --event=ProcessedEvent --enum=Status --trait=Cacheable --route\n```\n\n### Adding Components to Existing Plugins (v1.5)\n\nYou can add new components to existing plugins without recreating them:\n\n```bash\n# Add a command to existing plugin\nphp artisan make:plugin ExistingPlugin --command=NewCommand\n\n# Add multiple components to existing plugin\nphp artisan make:plugin ExistingPlugin --controller=ApiController --event=UserRegistered --enum=Status --trait=Cacheable --route\n\n# If component already exists, it will be skipped with a warning\nphp artisan make:plugin ExistingPlugin --command=ExistingCommand\n# Output: Command file 'ExistingCommand.php' already exists in plugin 'ExistingPlugin'. Skipping...\n```\n\nThis creates the following structure:\n\n```\napp/Plugins/MyAwesomePlugin/\n├── config.php                          # Plugin configuration\n├── routes.php                          # Plugin routes\n├── MyAwesomePluginProvider.php         # Service provider (auto-created)\n├── Controllers/\n│   └── MyAwesomePluginController.php   # Plugin controller\n├── Services/\n│   ├── MyAwesomePluginService.php      # Plugin service\n│   └── MyAwesomePluginServiceInterface.php # Service interface\n├── Commands/                           # Generated commands (v1.5)\n│   └── ProcessDataCommand.php\n├── Events/                             # Generated events (v1.5)\n│   └── DataProcessedEvent.php\n├── Listeners/                          # Generated listeners (v1.5)\n│   └── SendNotificationListener.php\n├── Status.php                          # Generated enum\n├── Cacheable.php                       # Generated trait\n└── Views/\n    └── index.blade.php                 # Livewire Volt component or Blade view\n```\n\n### Plugin Structure\n\n#### Config File (`config.php`)\n```php\n\u003c?php\nreturn [\n    'name' =\u003e 'MyAwesomePlugin',\n    'version' =\u003e '1.0.0',\n    'description' =\u003e 'MyAwesomePlugin plugin',\n    'enabled' =\u003e true,\n];\n```\n\n#### Routes File (`routes.php`)\n```php\n\u003c?php\nuse Livewire\\Volt\\Volt;\n\nVolt::route('/', 'index');\n```\n\n#### Controller\n```php\n\u003c?php\nnamespace App\\Plugins\\MyAwesomePlugin\\Controllers;\n\nuse App\\Http\\Controllers\\Controller;\n\nclass MyAwesomePluginController extends Controller\n{\n    public function index()\n    {\n        // Controller logic\n    }\n}\n```\n\n#### Service \u0026 Interface\n```php\n\u003c?php\nnamespace App\\Plugins\\MyAwesomePlugin\\Services;\n\ninterface MyAwesomePluginServiceInterface\n{\n    public function handle(): array;\n}\n\nclass MyAwesomePluginService implements MyAwesomePluginServiceInterface\n{\n    public function handle(): array\n    {\n        return [\n            'message' =\u003e 'MyAwesomePlugin service is working!',\n            'timestamp' =\u003e now()-\u003etoISOString(),\n        ];\n    }\n}\n```\n\n#### Service Provider\n```php\n\u003c?php\nnamespace App\\Plugins\\MyAwesomePlugin;\n\nuse Illuminate\\Support\\ServiceProvider;\n\nclass MyAwesomePluginProvider extends ServiceProvider\n{\n    public function register(): void\n    {\n        // Register plugin services here\n    }\n\n    public function boot(): void\n    {\n        // Boot plugin services here\n    }\n}\n```\n\n#### Enum\n```php\n\u003c?php\nnamespace App\\Plugins\\MyAwesomePlugin;\n\nenum Status: string\n{\n    case ACTIVE = 'active';\n    case INACTIVE = 'inactive';\n    case PENDING = 'pending';\n}\n```\n\n#### Trait\n```php\n\u003c?php\nnamespace App\\Plugins\\MyAwesomePlugin;\n\ntrait Cacheable\n{\n    protected int $cacheTimeout = 3600;\n\n    public function getCacheKey(string $suffix = ''): string\n    {\n        return static::class . ($suffix ? \":{$suffix}\" : '');\n    }\n\n    public function clearCache(string $suffix = ''): void\n    {\n        cache()-\u003eforget($this-\u003egetCacheKey($suffix));\n    }\n}\n```\n\n#### Views\n\nThe plugin system supports both **Livewire Volt** and **traditional Blade** views:\n\n**Volt Component (default):**\n```php\n\u003c?php\nnew class extends \\Livewire\\Volt\\Component\n{\n    public string $message = 'Welcome to MyAwesomePlugin Plugin!';\n\n    public function mount(): void\n    {\n        $this-\u003emessage = 'Hello from MyAwesomePlugin!';\n    }\n}\n?\u003e\n\n\u003cdiv class=\"p-6 bg-white rounded-lg shadow-md\"\u003e\n    \u003ch1 class=\"text-2xl font-bold text-gray-800 mb-4\"\u003eMyAwesomePlugin Plugin\u003c/h1\u003e\n    \u003cp class=\"text-gray-600 mb-4\"\u003e{{ $message }}\u003c/p\u003e\n\u003c/div\u003e\n```\n\n**Traditional Blade View:**\n```blade\n@extends('layouts.app')\n\n@section('content')\n\u003cdiv class=\"p-6 bg-white rounded-lg shadow-md\"\u003e\n    \u003ch1 class=\"text-2xl font-bold text-gray-800 mb-4\"\u003eMyAwesomePlugin Plugin\u003c/h1\u003e\n    \u003cp class=\"text-gray-600 mb-4\"\u003eWelcome to MyAwesomePlugin Plugin!\u003c/p\u003e\n    \n    \u003cdiv class=\"bg-blue-50 border border-blue-200 rounded-lg p-4\"\u003e\n        \u003ch2 class=\"text-lg font-semibold text-blue-800 mb-2\"\u003ePlugin Information\u003c/h2\u003e\n        \u003cul class=\"text-blue-700 space-y-1\"\u003e\n            \u003cli\u003e\u003cstrong\u003eView Type:\u003c/strong\u003e Traditional Blade\u003c/li\u003e\n        \u003c/ul\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n@endsection\n```\n\n### Accessing Plugins\n\nOnce created, your plugin will be automatically registered and accessible via:\n\n- **Routes**: `http://your-app.com/myawesomeplugin/` (or `/plugins/myawesomeplugin/` if prefix is enabled)\n- **Config**: `config('MyAwesomePlugin.name')`\n- **Services**: Injected via dependency injection or `app(MyAwesomePluginServiceInterface::class)`\n\n### Service Injection\n\nPlugin services are automatically registered and can be injected:\n\n```php\nclass SomeController extends Controller\n{\n    public function __construct(\n        private MyAwesomePluginServiceInterface $pluginService\n    ) {}\n\n    public function index()\n    {\n        $result = $this-\u003epluginService-\u003ehandle();\n        return response()-\u003ejson($result);\n    }\n}\n```\n\n## Advanced Configuration\n\n### Custom Plugin Path\n\nYou can change the default plugin path in the configuration:\n\n```php\n'plugins_path' =\u003e base_path('custom/plugins'),\n```\n\n### Custom Namespace\n\nChange the base namespace for plugins:\n\n```php\n'plugin_namespace' =\u003e 'Custom\\\\Plugins',\n```\n\n### Route Prefixing\n\nEnable route prefixing to add 'plugins/' to all plugin routes:\n\n```php\n'use_plugins_prefix_in_routes' =\u003e true,\n```\n\n## Requirements\n\n- PHP 8.1+\n- Laravel 10.0+ or 11.0+\n- Livewire Volt 1.0+ (for view components)\n\n## License\n\nThis package is open-sourced software licensed under the [MIT license](LICENSE).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Support\n\nIf you discover any security vulnerabilities or bugs, please send an e-mail to soysaltan@hotmail.it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamientos%2Flaravel-plugin-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparamientos%2Flaravel-plugin-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamientos%2Flaravel-plugin-system/lists"}