envatic / crud-strap
Laravel CRUD Generator
5.0.9
2024-07-29 18:24 UTC
Requires
- illuminate/support: ^11
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^11.0.1
- dev-master
- 5.0.9
- 5.0.7
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.1.0
- 4.0.9
- 4.0.8
- 4.0.7
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- v4.0.0
- v3.3.0
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.0
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0-beta
- 2.0.x-dev
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.2.x-dev
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.0
- dev-develop
This package is auto-updated.
Last update: 2024-11-06 23:47:29 UTC
README
Advanced crud Generator for laravel Generates the following;
Model (plus auto relationships, and casts)
Form validation ( In controller)
Inertia (vue3) Controller or
ApiResource
Database migration
Routes
Policy
Inertia views (vue3)
php enums
Requirements
Laravel >= 11
PHP >= 8.3
Installation
composer require envatic/crud-strap --dev
Step by Step
- Install crud-strap
composer require envatic/crud-strap --dev
- Publish Assets
php artisan vendor:publish
choose the crudstrap service provider
- Create a folder for your theme inside /crud folder eg /crud/admin/ in your laravel app
- Add your crudjson files in this folder Example file for projects table.
{ "fields": [ { "name": "user_id", "type": "foreignId|constrained|onUpdate:'cascade'|onDelete:'cascade'", "rules": "required|integer|exists:users,id" }, { "name": "uuid", "type": "uuid" }, { "name": "name", "type": "string", "rules": "required|string" }, { "name": "slug", "type": "string", "rules": "required|string" }, { "name": "description", "type": "text|nullable", "rules": "required|string" }, { "name": "status", "type": "radioselect|default:'pending'", "options": { "pending": "Under Review", "published": "Publish To Website", "hidden": "Hide from Users", "rejected": "Reject Project" }, "rules": "required|string" }, { "name": "rank", "type": "integer", "rules": "required|string" }, { "name": "verified_at", "type": "timestamp|nullable" }, { "name": "promoted_at", "type": "timestamp|nullable" } ], "relationships": [ { "name": "user", "type": "belongsTo", "class": "User|user_id|id" }, { "name": "uploads", "type": "morphMany", "class": "Upload|uploadable" }, { "name": "logo", "type": "morphOne|where:'key','logo'", "class": "Upload|uploadable" } ] }
- Update
config/crudstrap.php
config file to include your new theme
[ "name" => 'admin', "view-path" => 'admin', 'folder' => "crud/admin", 'force' => true, 'model-namespace' => 'Models', 'only' => 'policy,controller,model,migration,route,factory,resource,enums', ],
- run
php artisan crud:strap admin
License
This project is licensed under the MIT License - see the License File for details