Download the PHP package hasanhawary/dynamic-cli without Composer
On this page you can find all versions of the php package hasanhawary/dynamic-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hasanhawary/dynamic-cli
More information about hasanhawary/dynamic-cli
Files in hasanhawary/dynamic-cli
Package dynamic-cli
Short Description A Laravel package providing a dynamic CLI scaffolder for CRUD generation (skeleton).
License MIT
Homepage https://github.com/hasanhawary/dynamic-cli
Informations about the package dynamic-cli
Absolutely! Iβve written a full, highly detailed, professional README for your Dynamic CLI CRUD package, with all advanced features, CLI flow, schema examples, enums, translatable fields, relations, file uploads, and best Laravel package practices.
Hereβs the complete README you can directly use:
π§ Dynamic CLI CRUD Generator for Laravel
Dynamic CLI CRUD is a smart, interactive generator for Laravel that creates production-ready CRUD modules (models, controllers, requests, resources, migrations, enums) with automatic schema detection, relations, enums, translatable fields, and file handling.
β¨ Key Features
- π§ Smart Schema Detection: Detects field types, required fields, unique constraints, enums, file uploads, and relations automatically.
- π― Enum Handling: Automatically generates Enum classes for fields like
status = enum[pending,approved,rejected]. - π Translatable Fields: Detects multilingual fields (
ar,en, etc.) and stores them in JSON columns. - π Relations Awareness: Detects
belongsToforeign keys (e.g.,country_id) and sets up metadata for CRUD. - πΌοΈ File Uploads: Supports file fields (
file,image, etc.) with category and allowed file types. - β‘ Interactive CLI: Step-by-step guidance for CRUD generation.
- π¦ Full CRUD Generation: Creates Model, Controller, Request, Resource, Migration, and Enum classes automatically.
- πͺ Force Overwrite: Re-generate existing files safely using
--force. - π Optional Frontend Integration: Specify a frontend path to scaffold integration-ready modules.
- π Detailed Schema Analysis: Shows a complete mapping of all fields with metadata in CLI before generation.
π¦ Installation
Install via Composer:
β Auto-discovers the service provider. No manual registration needed.
β‘ Quick Start
Generate a CRUD module interactively:
Or provide the name directly and force overwrite if needed:
πΉ Example CLI Flow
πΉ JSON Schema Example
πΉ Final Schema Mapping (CLI Output)
π CRUD File Generation
After confirmation, the generator creates:
| File Type | Path Example |
|---|---|
| Enum | app/Enum/DataEntry/StatusEnum.php |
| Model | app/Models/Product.php |
| Controller | app/Http/Controllers/API/DataEntry/ProductController.php |
| Request | app/Http/Requests/DataEntry/ProductRequest.php |
| Resource | app/Http/Resources/DataEntry/ProductResource.php |
| Migration | database/migrations/2025_10_22_172830_create_products_table.php |
Next steps:
πΉ Advanced Features
Enum Handling π―
- Automatically generates Enum classes for any field defined as
enum[...]. - Enum classes include a static
resolve($value)method for easy mapping.
Translatable Fields π
- Detects JSON structures with language keys (
ar,en). - Stores translations in JSON column for multilingual support.
Relations Detection π
- Detects fields ending with
_idor typed asforeignId. -
Prepares metadata for
belongsTorelationships automatically. - Generates relation info for controller, resource, and request.
File Uploads πΌοΈ
- Supports file fields (
file,image,pdf,docx). - Detects category and allowed file types.
- Integrates with Laravel file handling in requests.
CLI Options & Metadata
- Force:
--forceto overwrite existing files. - Group: Organize CRUD modules by logical group (e.g., DataEntry).
- Table Name: Auto-generated from model name but customizable.
- Route: Default
api, can be extended toweb.
π§ Optional Frontend Integration
The CLI can scaffold integration-ready modules for your frontend:
π€ Contribution
- Fork the repository
-
Create a feature branch:
-
Commit your changes:
-
Push the branch:
- Open a pull request
π¦ Version Support
- PHP: 8.1 β 8.3
- Laravel: 10.x
π License
MIT Β© Hasan Hawary
π Links
- GitHub: https://github.com/hasanhawary/dynamic-cli
- Packagist: https://packagist.org/packages/hasanhawary/dynamic-cli
All versions of dynamic-cli with dependencies
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/console Version ^10.0 || ^11.0 || ^12.0 || ^13.0
hasanhawary/lookup-manager Version *
hasanhawary/media-manager Version *