Backpack\CRUD provides a fast way to build administration panels - places where your administrators can Create, Read, Update, Delete entries for a specific Eloquent model. One CRUD Panel provides functionality for one Eloquent Model.
In order to create a CRUD Panel, you'll need:
If you don't already have the models, don't worry, Backpack also includes a faster way to generate database migrations and models.
A Backpack CRUD Panel uses the same elements you would have created for an administration panel, if you were doing it from scratch:
routes/backpack/custom.php; points to a controller;
app/Http/Controllers/Admin; holds the logic for the all operations an admin can perform on that Eloquent model;
app/Http/Requests; used to validate Create/Update forms;
The only differences between building it from scratch and using Backpack\CRUD are that:
Backpack\CRUD\app\Http\Controllers\CrudController, which allows you to easily add traits to handle the already-built operations: Create, Update, Delete, List, Show, Reorder, Revisions etc.
This simple architecture (
ProductCrudController extends CrudController) means:
Product is shown to the admin? just create a method called
show() in your
ProductCrudController; simple OOP dictates that your method will be picked up, instead of the one in the
ShowOperation trait; some goes for
store(), etc - you have complete control;
ProductCrudController is a great place for that logic; just create a custom
publish() method and a route that points to it;
Tag entity, your CRUD Panel would consist of:
To further your understanding of how a CRUD Panel works, read more about this example in the tutorial.