Download the PHP package innonazarene/prism-init without Composer
On this page you can find all versions of the php package innonazarene/prism-init. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download innonazarene/prism-init
More information about innonazarene/prism-init
Files in innonazarene/prism-init
Package prism-init
Short Description Laravel Artisan command to scaffold models, services, controllers, requests, resources, policies and API routes from your database.
License MIT
Informations about the package prism-init
Prism Init
Prism Init scaffolds a complete, convention-following backend API from your existing database in one command.
What gets generated per table
| Artifact | Path (grouped, default) |
|---|---|
| Eloquent Model | app/Models/Employee/Employee.php |
| Service | app/Services/Employee/EmployeeService.php |
| Controller | app/Http/Controllers/Api/V1/Employee/EmployeeController.php |
| Store Request | app/Http/Requests/Employee/StoreEmployeeRequest.php |
| Update Request | app/Http/Requests/Employee/UpdateEmployeeRequest.php |
| API Resource | app/Http/Resources/Employee/EmployeeResource.php |
| Policy | app/Policies/Employee/EmployeePolicy.php |
| API Routes | routes/api.php — Route::apiResource('employees', …) |
Plus, once:
| Artifact | Path |
|---|---|
ApiResponse Trait |
app/Traits/ApiResponse.php |
Conventions followed
Database (3.3.1)
- Table names:
snake_case, plural (employees,salary_grades) - Model names:
PascalCase, singular (Employee) - Soft deletes:
deleted_aton every model (configurable) - Timestamps:
created_at,updated_aton every model
PHP / Laravel (3.3.2)
- Models:
PascalCasesingular,$fillable,$casts,SoftDeletes— columns auto-populated from DB - Controllers: thin — validate → delegate to Service → return Resource
- Services: all business logic inside
DB::transaction()where needed,list()returns paginated results - Requests:
Store{Model}Request/Update{Model}Request— validation rules inferred from DB column types - Resources:
{Model}Resource— all fields auto-populated from DB columns - Policies:
{Model}Policywith all standard gates stubbed - Response envelope: consistent
{ success, data, message, errors }viaApiResponsetrait
Requirements
| PHP | ^8.1 |
| Laravel | ^10 | ^11 | ^12 | ^13 |
Installation
Publish the config if you want to customise defaults:
Publish stubs to customise them (optional):
Usage
Options
| Option | Description |
|---|---|
--prefix=v1 |
Route prefix (default: v1 → /api/v1/…) |
--grouped |
Force grouped folder structure |
--flat |
Force flat folder structure |
--no-timestamps |
Disable $timestamps on models |
--no-soft-deletes |
Skip SoftDeletes on models |
--skip-migrate |
Skip migration generation |
--skip-seed |
Skip seeding |
--skip-services |
Skip Service class generation |
--skip-resources |
Skip API Resource generation |
--skip-policies |
Skip Policy generation |
--tables=users,products |
Only scaffold listed tables |
--force |
Overwrite existing files |
Examples
Generated output example
Given a departments table, Prism Init produces:
app/Models/Department/Department.php
app/Services/Department/DepartmentService.php
app/Http/Controllers/Api/V1/Department/DepartmentController.php
app/Http/Requests/Department/StoreDepartmentRequest.php
app/Http/Resources/Department/DepartmentResource.php
app/Traits/ApiResponse.php — envelope methods:
routes/api.php
Customising stubs
After publishing stubs (--tag=prism-init-stubs), edit any file in stubs/prism-init/.
Prism Init always prefers your published stub over the package default.
Available stubs:
| Stub | Purpose |
|---|---|
model.stub |
Eloquent model |
service.stub |
Service class |
controller.stub |
API controller |
Store-request.stub |
Store Form Request |
Update-request.stub |
Update Form Request |
resource.stub |
API Resource |
policy.stub |
Policy |
api-response.stub |
ApiResponse trait |
Optional Packages
Prism Init detects these packages at runtime. If installed, they are used automatically — if not, the step is skipped with an install hint.
| Package | Purpose |
|---|---|
| kitloong/laravel-migrations-generator | Generate migrations from existing DB |
| orangehill/iseed | Generate seeders from live data |
Backup & re-running
On every run, Prism saves clean copies of routes/api.php and Controller.php to public/backup/
and restores them before regenerating — so you always start from a clean slate.
Contributing
Pull requests welcome. Please open an issue first to discuss changes.
License
MIT — see LICENSE.
All versions of prism-init with dependencies
kitloong/laravel-migrations-generator Version ^7.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/filesystem Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0