package-make was abandon, please use packagit:
https://github.com/packagit/packagit
You can manage huge project with many separate laravel packages.
Thanks to nwidart/laravel-modules
, I get many code from it and reimplement.
Why I re-implement (don't use nwidart/laravel-modules
)?
nwidart/laravel-modules
stubs injectedmodule_path
, you can't remove it in production.- Just a standard composer package, you don't need
nwidart/laravel-modules
to manage modules. - Update some stubs and folders structure, keep it like laravel.
- You can remove this package in production, Just required in devepopment.
So I seperate new one zencodex/package-make
, resovled above issues.
You can install the package via composer:
composer require --dev zencodex/package-make
// modules/NewPackage
php artisan package:make NewPackage
NewPackage structure:
modules/NewPackage
├── Config
│ └── config.php
├── Console
│ └── UserCommand.php
├── Database
│ ├── Migrations
│ ├── Seeders
│ │ └── NewPackageDatabaseSeeder.php
│ └── factories
├── Http
│ ├── Controllers
│ │ └── NewPackageController.php
│ ├── Middleware
│ ├── Requests
│ └── Resources
│ └── UserResource.php
├── Models
│ └── User.php
├── Providers
│ ├── NewPackageServiceProvider.php
│ └── RouteServiceProvider.php
├── Resources
│ ├── assets
│ │ ├── js
│ │ │ └── app.js
│ │ └── sass
│ │ └── app.scss
│ ├── lang
│ └── views
│ ├── index.blade.php
│ └── layouts
│ └── master.blade.php
├── Routes
│ ├── api.php
│ └── web.php
├── Tests
│ ├── Feature
│ └── Unit
├── composer.json
├── package.json
└── webpack.mix.js
php artisan vendor:publish --tag=package
// edit config/package.php
// use namespace Balabala
// generate package files in plugins folder
return [
// Custom package namespace
'namespace' => 'Balabala',
'paths' => [
// Custom generated files path
'modules' => base_path('plugins'),
// ...
option 1:
// app/Providers/AppServiceProvider.php
use Package\NewPackage\Providers\NewPackageServiceProvider;
class AppServiceProvider extends ServiceProvider
public function register()
{
$this->app->register(NewPackageServiceProvider::class);
...
}
or
Edit config/app.php
, add Package\NewPackage\Providers\NewPackageServiceProvider::class
to providers.
'providers' => [
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Package\NewPackage\Providers\NewPackageServiceProvider::class
...
],
option 2:
// 1. edit composer.json, add following
"repositories": [
{
"type": "path",
"url": "modules/*"
}
]
// use private package or gitlab
"repositories": [
{
"type": "vcs",
"url": "[email protected]:/newpackage.git"
}
]
// 2. composer require local path package (replace package/newpackage to yours)
composer require package/newpackage
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The Apache License 2. Please see License File for more information.