Quick Start
We use users
table come with Laravel
for example,the structure of table is:
And the model for this table is App\User.php
You can follow these steps to setup CRUD
interfaces of table users
:
Add controller
Use the following command to create a controller for App\User
model
The above command will create the controller in app/Admin/Controllers/UserController.php
.
Add route
Add a route in app/Admin/routes.php
:
Add left menu item
Open http://localhost:8000/admin/auth/menu
, add menu link and refresh the page, then you can find a link item in left menu bar.
Where
uri
fills in the path part that does not contain the prefix of the route, such as the full pathhttp://localhost:8000/admin/demo/users
Menu translations
append menu titles in menu_titles index at your language files. For example 'Work Units' title:
in resources/lang/es/admin.php
Build grid and form
The rest needs to be done is open app/Admin/Contollers/UserController.php
, find form()
and grid()
method and write few lines of code with model-grid
and model-form
,for more detail, please read model-grid and model-form.
Last updated