Add self-contained features to your Laravel app, including all resources/routes/etc.
.
└── app/
├── ...
├── Features/
│ └── MyGreatFeature/
│ ├── database/
│ │ ├── factories
│ │ ├── migrations
│ │ └── seeders
│ ├── resources
│ ├── routes
│ └── src/
│ ├── Models
│ ├── ...
│ └── ServiceProvider.php
└── ...You can install the package via composer:
composer require edalzell/laravel-featuresTo add a feature to your app:
php artisan make:feature MyGreatFeatureThis will create an empty (but necessary) service provider that autoloads/registers migrations, routes, & views and properly namespaces your factories, seeders and code.
If you want to add a feature manually, or convert something you already have into a feature:
- create an
app/Features/YourFeaturefolder - create a
ServiceProviderthat extendsFeatureServiceProvider. - add a
pre-autoload-dumpscript to yourcomposer.json:
"pre-autoload-dump": [
"Edalzell\\Features\\Composer\\FeatureNamespaces::add"
]
composer testPlease see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.