Download the PHP package sirgrimorum/crudgenerator without Composer
On this page you can find all versions of the php package sirgrimorum/crudgenerator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sirgrimorum/crudgenerator
More information about sirgrimorum/crudgenerator
Files in sirgrimorum/crudgenerator
Package crudgenerator
Short Description Automatic CRUD generator for Laravel
License MIT
Informations about the package crudgenerator
CrudGenerator
A config-driven CRUD framework for Laravel. Describe your model's fields in a PHP array and get a fully functional admin interface — create/edit forms, show views, searchable DataTables lists, file uploads, relationship selects, validation, and REST endpoints — without writing controllers, views, or JS glue code.
Features
- 20+ field types — text, email, password, number, textarea, HTML (CKEditor), date/datetime/time, select, checkbox, radio, relationship (BelongsTo), relationships (ManyToMany), files (single and multiple), color picker, range slider, JSON editor, computed functions, and more
- Auto-generated admin — create, show, edit, list, and delete views from a single config array
- DataTables integration — server-side or client-side paging, search, multi-select, export (Excel, PDF, copy)
- Validation — reads
$rulesfrom the model; custom validators for composite unique, older-than age, unique-with - File uploads — single or multiple files, automatic image resizing/thumbnailing, disk/path configurable
- Relationship fields —
BelongsToselects,ManyToManywith pivot columns, typeahead search - Access control — permission closure in config; per-action permission checks
- Dynamic value prefixes —
__route__,__trans__,__asset__,__config__,__view__, and more evaluated at render time - Modal support — create/edit forms can be embedded in Bootstrap modals
- Artisan code generation — scaffold model config, language file, Eloquent model class, and getter methods
- TransArticles integration —
articlefield type stores rich content in the articles table
Requirements
- PHP >= 8.2
- Laravel >= 9.0
- intervention/image ^3.0
- doctrine/dbal ^3.0|^4.0
Installation
Run migrations
Publish configuration
Publishes config/sirgrimorum/crudgenerator.php.
Publish language files
Publish views (optional)
Publish front-end assets
Publishes DataTables, CKEditor, Select2, DateTimePicker, and other JavaScript dependencies to public/vendor/sirgrimorum/.
Quick Start
1. Generate a config file for your model
This creates config/sirgrimorum/models/post.php with all columns pre-filled from the database schema.
2. Register the model in the main config
3. Access the admin interface
Navigate to /{locale}/crud/post to see the list, create, edit, and delete interface.
Model Configuration
Every feature of the CRUD admin is controlled by a config array. Store it in config/sirgrimorum/models/modelname.php.
Minimal example
Field type reference
| Type | Description |
|---|---|
text |
Single-line text input |
email |
Email input with validation |
url |
URL input |
password |
Password input (hashed on save) |
number |
Numeric input with optional format |
textarea |
Multi-line plain text |
html |
Rich text via CKEditor |
article |
Rich text stored in TransArticles table |
date |
Date picker |
datetime |
Date + time picker |
time |
Time picker |
select |
Dropdown from opciones array or callable |
checkbox |
Checkbox group |
radio |
Radio button group |
relationship |
BelongsTo — single related model select |
relationships |
HasMany/ManyToMany — multi-select list |
relationshipssel |
ManyToMany with pivot columns and typeahead |
file |
Single file upload |
files |
Multiple file upload (JSON array in DB) |
color |
Color picker |
slider |
Range slider |
json |
JSON editor (JSON Editor library) |
hidden |
Hidden input |
function |
Read-only computed value (calls model method) |
Complete field options
Rendering Admin Views
Use the static methods anywhere in your own controllers or views:
Or use the built-in routes at /{locale}/{admin_prefix}/{model} (index / create / show / edit / destroy).
Validation
CrudGenerator reads $rules from your model automatically:
Custom validation messages via $error_messages:
Custom validators provided by this package
| Rule | Description |
|---|---|
unique_composite:table,col1,col2 |
Unique across multiple columns |
unique_with:table,col1,col2 |
Alias for composite unique |
older_than:18 |
Minimum age validation for date fields |
with_articles:locale1,locale2 |
All article locales must be filled |
Artisan Commands
| Command | Description |
|---|---|
crudgen:createconfig {Model} |
Generate a model config file from DB schema |
crudgen:createlang {Model} |
Generate a language file for the model |
crudgen:createmodel {Model} |
Generate an Eloquent model class stub |
crudgen:addget {Model} |
Add get($field) accessor method to model |
crudgen:resources |
Publish front-end assets (JS/CSS libraries) |
crudgen:registererror |
Set up error tracking model |
crudgen:registermiddleware |
Register admin middleware |
crudgen:sendalert {title} {message} |
Broadcast an alert to the admin |
API Reference
CrudGenerator::lists()
CrudGenerator::create()
CrudGenerator::edit()
CrudGenerator::show()
CrudGenerator::validateModel()
CrudGenerator::saveObjeto()
Saves (creates or updates) a model instance, handles file uploads, and syncs relationships.
CrudGenerator::getConfigWithParametros()
Loads the model config, evaluates all __prefix__ values, and merges request parameters.
Dynamic Value Prefixes
Use these in any config value to have it evaluated at render time:
| Prefix | Resolves to |
|---|---|
__route__name |
route('name') |
__url__/path |
url('/path') |
__trans__key |
trans('key') |
__asset__path |
asset('path') |
__getLocale__ |
App::getLocale() |
__config__key |
config('key') |
__view__template |
view('template')->render() |
__transarticle__scope.key |
TransArticles content |
License
The MIT License (MIT). See LICENSE.md.
All versions of crudgenerator with dependencies
laravel/framework Version ^9.0|^10.0|^11.0|^12.0
intervention/image Version ^3.0
doctrine/dbal Version ^3.0|^4.0