Download the PHP package sajidul-islam/laravel-crud-generator without Composer
On this page you can find all versions of the php package sajidul-islam/laravel-crud-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sajidul-islam/laravel-crud-generator
More information about sajidul-islam/laravel-crud-generator
Files in sajidul-islam/laravel-crud-generator
Package laravel-crud-generator
Short Description A simple Laravel CRUD generator with web interface
License MIT
Informations about the package laravel-crud-generator
Laravel CRUD Generator
A Laravel package that lets you scaffold complete CRUD (Create, Read, Update, Delete) functionality—with models, migrations, controllers, requests, views, and routes—through a simple web-based UI or programmatically.
Features
-
Model Generation
Creates an Eloquent model class with fillable properties. -
Optional Migration Creation
Generates a timestamped migration file with columns based on your field definitions (string, text, integer, boolean, date, datetime, etc.), includingnullable
support. -
Controller Generation
Builds a resource controller with index, create, store, edit, update, show, and destroy methods. -
Form Request Generation
Generates a dedicated FormRequest class for server-side validation of your model's fields. -
Blade View Scaffolding
Produces a complete set of Blade templates (index
,create
,edit
,show
) underresources/views/{resource}
—including dynamic form inputs, tables, and detail pages. -
Automatic Route Registration
Appends aRoute::resource(...)
declaration toroutes/web.php
, enabling immediate access to your new CRUD endpoints. -
Web UI for Configuration
A Bootstrap- and Font Awesome-powered interface where you can:- Enter Model Name (PascalCase) and Table Name (snake_case, plural).
- Choose whether to generate a migration/seeder.
- Define fields (name, type, validation rules, nullable).
- Dynamically add/remove fields.
- Load quick field templates (Blog Post, Product, User).
- Programmatic (CLI) Usage
InjectCrudGeneratorService
into your own Artisan commands to generate CRUD definitions from an array of parameters.
Requirements
- PHP 8.0+
- Laravel 9.x+
- Composer
- Writable directories:
app/Models/
(for models)database/migrations/
(for migrations)app/Http/Controllers/
(for controllers)app/Http/Requests/
(for form requests)resources/views/
(for views)
Installation
-
Require the Package
-
(Optional) Migrate Your Database
Ensure your existing migrations are up-to-date before generating new tables.
Configuration
you can publish the configuration file with:
Typical settings include:
- Custom namespaces for generated classes.
- Default view paths.
- List of available field types in the UI dropdown.
If no config/crud-generator.php
appears after installation, the package works out-of-the-box with sensible defaults.
Usage
Web UI
-
Access the Generator
Open your browser and navigate to/crud-generator
. If your application uses a custom prefix (e.g.,admin
), adjust the URL accordingly. -
Fill Out the Form
- Model Name (PascalCase) (e.g.,
Post
) - Table Name (snake_case, plural) (e.g.,
posts
—auto-filled from Model Name) - Generate Migration (checkbox)
- Generate Seeder (checkbox)
-
Fields
- Field Name (snake_case, no spaces)
- Type (string, text, integer, boolean, date, datetime, email, password)
- Validation Rules (Laravel validation syntax, e.g.,
required|string|max:255
) - Nullable (checkbox)
-
Quick Templates
- Click a template button (e.g., "Blog Post", "Product", "User") to load predefined fields.
- Model Name (PascalCase) (e.g.,
- Generate CRUD
Click the "Generate CRUD" button. The package will scaffold files and append routes. A "Results" panel will list every created/modified file and next steps (e.g., runphp artisan migrate
).
CLI/Artisan Command
The package provides an Artisan command to generate CRUD operations directly from the command line:
Basic Usage
Available Options
{model}
- The name of the model (required)--table=
- The name of the table (optional, defaults to plural of model name)--fields=
- Fields in JSON format (optional)--no-migration
- Skip migration generation--with-seeder
- Generate seeder
Examples
1. Interactive Mode (Recommended for beginners)
This will prompt you to enter fields interactively.
2. With JSON Fields
3. Custom Table Name
4. Skip Migration
5. With Seeder
Programmatic Usage
You can also call the CrudGeneratorService
directly from within your own Artisan commands or controllers:
Troubleshooting
-
Directory Permissions
Ensureapp/Models/
,database/migrations/
,app/Http/Controllers/
,app/Http/Requests/
, andresources/views/
are writable (chmod -R 755 <directory>
). -
Route Duplication
If you regenerate CRUD for the same resource, you may see duplicateRoute::resource(...)
entries. Manually remove the extra line inroutes/web.php
. - UI FieldTypes Not Loading
If the UI's<select>
elements show empty, verify that your view is receiving a$fieldTypes
array. In a controller method serving the UI, you should pass something like:
Contributing
-
Fork the Repo
Clone your fork: -
Create a New Branch
-
Make Changes & Commit
Use clear, concise commit messages. -
Push & Open a PR
Open a pull request against the
main
branch. Include usage examples or tests if you introduce new functionality.
License
This package is released under the MIT License. Use, modify, and distribute freely.
Version
1.0.1
Repo activity
Acknowledgments
- Inspired by Laravel's scaffolders and community-driven CRUD generators.
- UI built with Bootstrap 5 and Font Awesome.
- Thanks to the Laravel community for ongoing inspiration and best practices.
Happy coding! 🚀
All versions of laravel-crud-generator with dependencies
laravel/framework Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
doctrine/dbal Version ^3.0|^4.0