Download the PHP package henrygodev/laranest without Composer
On this page you can find all versions of the php package henrygodev/laranest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download henrygodev/laranest
More information about henrygodev/laranest
Files in henrygodev/laranest
Informations about the package laranest
Laranest - Laravel with modules
A simple scaffolding package inspired by NestJs architecture. Each module encapsulates its own controller, requests, and model - keeping your application organized and scalable.
Requirements
- PHP ^7.4 | ^8.0
- Laravel ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0
Install
To install via Composer, run
The package is auto-discovery by Laravel - no need to register the service provider manually.
Usage
Basic module
Generates:
API module
Generate a controller with JSON response and full CRUD methods.
Resource module
Generate a controller with view returns and redirects, following Laravel's resource convention.
Migrations
Generate a migration file in database/migrations
Generates:
Running the command twice with -m will skip the migration if one already exists for that table.
Service layer
Generate a service class responsible for business logic. The controller delegates all work to the service and only handles HTTP responses.
Generates:
The service comes with the five standard CRUD methods pre-wired to the module's model:
When combined with --api or --resource, the controller is generated with the service injected via constructor and all methods delegating to it:
Without --service, the controller is generated without any constructor injection, keeping it decoupled from the service layer.
Combining flags
All flags are composable:
Multi-word names
The module name is automatically converted to StudlyCase and pluralized.
Both generate:
Configuration
Publish the config file to customize the package behavior:
This creates config/laranest.php in your project:
Changing the modules folder
All modules will now generate under app/Domain/.
Custom structure
Each entry in structure defines what gets generated and how. You control the folder, namespace, generator class, and stubs:
Custom generators
You can register your own generator class for any entry. The generator must extend BaseGenerator and implement generate():
Then declare it in your config:
From now on, every make:module will also generate a repository - without touching the package code.
Customizing stubs
Publish the defaults stubs to your project:
This copies all stubs to:
Edit any stub to match your project conventions. Published stubs take priority over the package defaults - you only need to publish the ones you want to customize.
Example: adding SoftDelete to every generated model:
From that point on, every module you generate will include SoftDeletes automatically.
Rollback on failure
If any file fails to generate, the package automatically removes all files an directories created during that run, leaving your project clean.
License
MIT
All versions of laranest with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0