csgt / crud
There is no license information available for the latest version (v8.0.16) of this package.
CRUD implementation
v8.0.16
2026-03-26 22:05 UTC
Requires
- php: >=7.2
- dev-master
- v8.0.16
- v8.0.15
- v8.0.14
- v8.0.13
- v8.0.12
- v8.0.11
- v8.0.10
- v8.0.9
- v8.0.8
- v8.0.7
- v8.0.6
- v8.0.5
- v8.0.4
- v8.0.3
- v8.0.2
- v8.0.1
- v8.0.0
- 7.x-dev
- 6.0.x-dev
- v6.0.32
- v6.0.31
- v6.0.30
- v6.0.29
- v6.0.28
- v6.0.27
- v6.0.26
- v6.0.24
- v6.0.23
- v6.0.22
- v6.0.21
- v6.0.20
- v6.0.19
- v6.0.18
- v6.0.17
- v6.0.16
- v6.0.15
- v6.0.14
- v6.0.13
- v6.0.12
- v6.0.11
- v6.0.10
- v6.0.9
- v6.0.8
- v6.0.7
- v6.0.6
- 6.0.5
- v6.0.4
- v6.0.3
- v6.0.2
- v6.0.1
- v6.0.0
- 5.9.x-dev
- v5.9.2
- v5.9.1
- v5.9.0
- 5.8.x-dev
- v5.8.1
- v5.8.0
- 5.7.x-dev
- v5.7.11
- v5.7.10
- v5.7.9
- v5.7.8
- 5.7.7
- 5.7.6
- 5.7.5
- 5.7.4
- 5.7.3
- 5.7.2
- 5.7.1
- 5.7.0
- 5.6.x-dev
- v5.6.23
- v5.6.22
- v5.6.21
- v5.6.20
- v5.6.19
- v5.6.18
- v5.6.17
- v5.6.16
- v5.6.15
- v5.6.14
- v5.6.13
- 5.6.10
- v5.6.9
- v5.6.8
- v5.6.7
- v5.6.6
- v5.6.5
- v5.6.4
- v5.6.3
- v5.6.2
- v5.6.1
- v5.6.0
- 5.5.x-dev
- v5.5.40
- v5.5.39
- v5.5.38
- v5.5.37
- v5.5.36
- v5.5.35
- v5.5.34
- v5.5.33
- v5.5.32
- v5.5.31
- v5.5.30
- v5.5.29
- v5.5.28
- v5.5.27
- v5.5.26
- v5.5.25
- v5.5.24
- v5.5.23
- v5.5.22
- v5.5.21
- v5.5.20
- v5.5.19
- 5.5
- 5.4.x-dev
- v5.4.0
- 5.3.x-dev
- v5.3.0
- 5.0.x-dev
- v5.0.17
- v5.0.16
- v5.0.15
- v5.0.14
- v5.0.13
- v5.0.12
- v5.0.11
- v5.0.10
- v5.0.9
- v5.0.8
- v5.0.7
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- dev-5.6.bs4
This package is auto-updated.
Last update: 2026-03-26 22:11:53 UTC
README
This package is used to generate cruds.
| Version | BS | Datatables | Methods | Views engine | Crypt | Constructor | UTC | Validation |
|---|---|---|---|---|---|---|---|---|
| 5.5 | 3 | 1.x | es | blade | yes | yes | no | formvaldiation |
| 5.6 | 4 | 1.x | es | blade | yes | yes | no | formvaldiation |
| 5.9 | 4 | 1.x | es | blade | yes | no | no | laravel |
| 6.0 | 4 | 1.x | en | blade | yes | yes | no | formvaldiation |
| 7.0 Beta | 4 | 1.x | en | vue | yes | yes | no | formvaldiation |
| 8.0 | 4/5 | 2.x | en | blade | no | no | yes | laravel |
Usage
To create a new CRUD, you may use the php artisan make:crud ExampleController command. This will set up a boilerplate
public function setup(Request $request)
{
//Required. Set the model to render
$this->setModel(new Model);
$this->setTitle('Title');
//This will render an extra button next to the Add button
$this->setExtraAction(['url' => '/module/import', 'title' => 'Importar']);
//Render the breadcrumb according to BS version
$this->setBreadcrumb([
['url' => '', 'title' => 'Catálogos', 'icon' => 'fa fa-book'],
['url' => '', 'title' => 'Titulo', 'icon' => 'fa fa-university'],
]);
//Set columns to show
$this->setField(['name' => 'Nombre', 'field' => 'name']);
$this->setField(['name' => 'Descripción', 'field' => 'descripcion']);
//Set combobox field
$this->setField([
'name' => 'Protocol',
'field' => 'protocol_id',
'type' => 'combobox',
'collection' => Protocol::select('id', 'name')->get(),
]);
//Campo Multi:
$this->setField(['name' => 'Requirements', 'type' => 'multi', 'field' => 'relationName']);
requiere en el modelo, crear la relation belongsToMany relationName
requiere en el modelo, crear el método fetchRelationName
opcional, si la columna para mostrar en el show, no se llama 'name'
crear el método fetchRelationNameColumn y retorne el campo deseado.
//Set hidden variables to append to inserts and updates
$this->setHidden(['field' => 'client_id', 'value' => 1]);
//Set extra button for each row in the Crud
$this->setExtraButton([
'url' => '/configuration/sensors?gateway_id={id}',
'icon' => 'fa fa-thermometer',
'title' => 'Sensors',
'class' => 'btn-warning',
]);
//Set permissions using the ['edit' => true, 'create' => true, 'delete' => true] syntax
$this->setPermissions(Cancerbero::crudPermissions('module'));
}
Upgrade from version 6 to version 8 or from 5.6 to 5.9
Add the following includes:
use Illuminate\Http\Request;
use Csgt\Cancerbero\Facades\Cancerbero;
Rename the __construct method to:
public function setup(Request $request)
Call the setPermissions directly
$this->setPermissions(Cancerbero::crudPermissions('module'));
Remove all references to Crypt::encrypt and Crypt::decrypt if any methos were overriden.
Remove all references to validationRulesMessages or reglasmensaje
Remove the enclosing middleware. It is now unnecessary.
$this->middleware(function ($request, $next) {
return $next($request);
});