envatic / crud-strap
Laravel CRUD Generator
Requires
- illuminate/support: ^11.0|^12.0
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^11.0.1
- dev-master
- 5.1.0
- 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: 2025-03-09 08:27:38 UTC
README
CrudStrap is a powerful Laravel package that automates the creation of CRUD (Create, Read, Update, Delete) operations for your application. It generates controllers, models, views, migrations, and other necessary files based on your specifications, saving you time and effort in the development process.
Features
- Generates CRUD operations for Laravel applications
- Creates controllers, models, views, migrations, and more
- Supports Inertia.js and Vue.js for frontend
- Customizable templates and configurations
- Handles relationships, validations, and file uploads
- Supports enum creation and usage
- Generates API resources and policies
Installation
To install CrudStrap, run the following command in your Laravel project:
composer require envatic/crudstrap
After installation, publish the package assets:
php artisan vendor:publish --provider="Envatic\CrudStrap\CrudStrapServiceProvider"
Configuration
The package configuration file is located at config/crudstrap.php
. You can customize various aspects of the CRUD generation process, including:
- Custom templates
- Namespace settings
- Pagination
- Route groups
- Localization
Usage
To generate CRUD files, use the crud:strap
command:
php artisan crud:strap {theme}
Replace {theme}
with the name of your desired theme configuration from the config/crudstrap.php
file.
Creating CRUD JSON Files
Before running the command, create JSON files in your specified crud folder (default is crud/
) to define your CRUD structures. Example:
{ "fields": [ { "name": "title", "type": "string", "rules": "required|max:255" }, { "name": "content", "type": "text", "rules": "required" } ], "relationships": [ { "name": "author", "type": "belongsTo", "class": "User" } ] }
Available Commands
crud:delete {theme}
: Remove generated CRUD files
Frontend Components
CrudStrap provides various Vue components to use in your views:
- ConfirmationModal
- FormInput
- FormLabel
- FormTextArea
- Loading
- LogoInput
- Modal
- Pagination
- PrimaryButton
- RadioCards
- RadioSelect
- SearchInput
- Switch
- VueIcon
These components are automatically published to your project's components directory.
Customization
You can customize the generated files by modifying the stubs in the resources/crud-strap/
directory after publishing the package assets.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
CrudStrap is open-sourced software licensed under the MIT license.