Installation and Setup
Requirements
Environment | Requirements |
---|---|
Laravel | 9.x / 10.x / 11.x |
PHP | 8.0 or higher |
Installation
sh
composer require fresns/plugin-manager
Configuration
Plugin Manager config file
- Publish command
sh
php artisan vendor:publish --provider="Fresns\PluginManager\Providers\PluginServiceProvider"
Main program composer.json
configuration
The Plugin Manager will automatically add
json
{
"extra": {
"merge-plugin": {
"include": [
"plugins/*/composer.json"
// The windows system is: \\plugins\\*\\composer.json
],
"recurse": true,
"replace": false,
"ignore-duplicates": false,
"merge-dev": true,
"merge-extra": true,
"merge-extra-deep": true
}
},
"config": {
"allow-plugins": {
"wikimedia/composer-merge-plugin": true
}
}
}
Directory Structure
php
laravel/ // Main Program
├── config/ // Configuration file directory
│ └── plugins.php // Plugin config file
├── plugins/ // Plugin directory
└── fresns.json // Plugin activate and deactivate status