A Laravel package providing a dynamic CLI scaffolder for CRUD generation (skeleton).
hasanhawary/dynamic-cli is a Laravel package for a laravel package providing a dynamic cli scaffolder for crud generation (skeleton)..
It currently has 1 GitHub stars and 218 downloads on Packagist (latest version v1.2.3).
Install it with composer require hasanhawary/dynamic-cli.
Discover more Laravel packages by hasanhawary
or browse all Laravel packages to compare alternatives.
Last updated
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 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.
status = enum[pending,approved,rejected].ar, en, etc.) and stores them in JSON columns.belongsTo foreign keys (e.g., country_id) and sets up metadata for CRUD.file, image, etc.) with category and allowed file types.--force.Install via Composer:
composer require hasanhawary/dynamic-cli --dev
β Auto-discovers the service provider. No manual registration needed.
Generate a CRUD module interactively:
php artisan cli:crud Product
Or provide the name directly and force overwrite if needed:
php artisan cli:crud Product --force
==============================================
π§ Dynamic CLI CRUD Generator
Build smart CRUDs in seconds
β‘ Powered by Hasan Hawary
==============================================
π Welcome!
Enter group name (default: DataEntry) [DataEntry]:
>
Custom table name? (press Enter for default) [products]:
>
Do you have a custom JSON schema? (yes/no) [no]:
> yes
π‘ Schema Reference Guide
-------------------------------------------------------------
Symbol-based field modifiers:
* => required field (is_nullable = false)
^ => unique field (is_unique = true)
enum[...] => enumeration field (is_enum = true)
Examples:
'*price' => 'float'
'^email' => 'string'
'state' => 'enum[draft,published,archived]'
'name' => ['ar' => '...', 'en' => '...'] // translatable field
'photo' => 'file'
'country_id' => 1 // foreign key
-------------------------------------------------------------
Opening temporary file... Write your JSON schema and save/close.
{
"*name": {
"ar": "Ψ§Ψ³Ω
Ψ§ΩΩ
ΩΨͺΨ¬",
"en": "Product Name"
},
"description": {
"ar": "ΩΨ΅Ω Ψ§ΩΩ
ΩΨͺΨ¬",
"en": "Product Description"
},
"^phone": "string",
"photo": "file",
"status": "enum[pending,approved,rejected]",
"country_id": 1
}
π§ Analyzing schema...
π Final Schema Mapping:
- name β json (π translatable, π« not null)
- description β json (π translatable)
- phone β string (π unique)
- photo β file (πΌοΈ file(jpg|jpeg|png|pdf|doc|docx))
- status β string (π― enum[pending|approved|rejected])
- country_id β foreignId (π relation(Country))
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:
php artisan migrate
enum[...].resolve($value) method for easy mapping.$status = StatusEnum::resolve('pending'); // returns 'pending'
ar, en)."*name": { "ar": "Ψ§Ψ³Ω
Ψ§ΩΩ
ΩΨͺΨ¬", "en": "Product Name" }
_id or typed as foreignId.belongsTo relationships automatically."country_id": 1
file, image, pdf, docx)."photo": "file"
--force to overwrite existing files.api, can be extended to web.The CLI can scaffold integration-ready modules for your frontend:
Would you like to integrate this module with a frontend project? (yes/no)
> yes
Please specify the absolute path to your frontend project:
> /path/to/frontend
git checkout -b feature/my-feature
git commit -am "Add new feature"
git push origin feature/my-feature
MIT Β© Hasan Hawary