Repository navigation
Admin screens
Alexey Averikhin edited this page Dec 4, 2026
·
1 revision
One command generates a complete admin screen: model, migration, list, form, permission, menu entry, texts and tests.
make shell
php artisan app:make-feature Product
php artisan migrateOpen http://localhost/admin/products as the administrator. Products is in the sidebar, with a searchable list, CSV export and forms to add, change and delete.
| Model, migration, factory |
app/Models/Product.php, database/migrations/…_create_products_table.php, database/factories/ProductFactory.php
|
| The screen |
app/Http/Controllers/Admin/ProductController.php, its route in routes/web.php, breadcrumbs in routes/breadcrumbs.php
|
| Who may open it | the products.manage permission in config/permissions.php, the menu entry in config/menu.php
|
| Texts | lang/en.json |
| Tests |
tests/Feature/ProductScreenTest.php: permissions, listing, search, create, change, delete, validation |
-
Add your columns to the migration,
$fillablein the model, the factory, andcolumns()andfields()in the controller. The Gentelella for Laravel docs list every column and field type.AnnouncementControlleris a complete example: an excerpt column, field hints, a CSV export. -
Let other roles in. Administrators see the screen at once. For another role, tick
products.manageon the role's page under Roles. -
Check it with
make check: code style, static analysis and all tests, yours included.
- Every admin route is in the
adminmiddleware group and asks for its permission withcan:. Tests fail when one doesn't. - Data changes use POST, PUT, PATCH or DELETE with CSRF protection; destructive actions ask for confirmation.
- Writable attributes are listed in
$fillable.
CSV exports don't neutralize spreadsheet formulas. Take care opening exports of text that users typed.
Laravel Boilerplate
Project home | Laravel documentation | Labs64 NetLicensing | NetLicensing API