Creating The Package
Run the command php artisan make:custom-package {vendor}/{package_name} (eg php artisan make:custom-package Fosetico/Accounts)
The new package will be created in the following structure:
- packages
- {vendor}
- {package_name}
- src
- Actions
- Console
- Commands
- Controllers
- Migrations
- Models
- Nova
- Settings
- Observers
- routes
- web.php
- api.php
- src
- {package_name}
- {vendor}
Create Migrations
php artisan make:migration {migration_name} --path=packages/{vendor}/{package_name}/database/migrations (eg php artisan make:migration create_my_custom_model --path=packages/fosetico/accounts/database/migrations)
In case the package is already activated in the system run php artisan migrate.
Create Models
php artisan make:custom-model {vendor}/{package_name}/{MyCustomModel} (eg php artisan make:custom-model Fosetico/Accounts/MyCustomModel)
Create custom Privileges/Permissions
php artisan make:custom-policy {vendor}/{package_name}/{MyCustomModel} (eg php artisan make:custom-policy Fosetico/Accounts/MyCustomModel)
php artisan make:custom-policy-all {vendor}/{package_name} (eg php artisan make:custom-policy-all Fosetico/Accounts)
Create Nova Resource
php artisan make:custom-nova-resource {vendor}/{package_name}/{MyCustomNovaResource} (eg php artisan make:custom-nova-resource Fosetico/Accounts/MyCustomModel)
Create Controllers
php artisan make:custom-controller {vendor}/{package_name}/{MyCustomModel} (eg php artisan make:custom-controller Fosetico/Accounts/MyCustomModel)
Create custom Nova Settings
php artisan make:custom-setting {vendor}/{package_name} (eg php artisan make:custom-setting Fosetico/Accounts)
Install Package in the system
php artisan install:custom-package {vendor}/{package_name} (eg php artisan install:custom-package Fosetico/Accounts)
run composer dump-autoload
Uninstall Package from the system
php artisan uninstall:custom-package {vendor}/{package_name} (eg php artisan uninstall:custom-package Fosetico/Accounts)
Note: When uninstalling a package the database is not affected (no tables are deleted)
Install a Profile
php artisan install:custom-profile {profile} (eshop/jinius)