Skip to content

Commit

Permalink
用户列表修改
Browse files Browse the repository at this point in the history
  • Loading branch information
gyp719 committed Dec 16, 2022
1 parent e8ab7e4 commit c472a41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
18 changes: 2 additions & 16 deletions app/Admin/Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use App\Models\User;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;

class UsersController extends AdminController
Expand All @@ -25,26 +24,13 @@ protected function grid(): Grid
});
}

protected function detail($id): Show
{
return Show::make($id, new User(), function (Show $show) {
$show->field('id');
$show->field('name');
$show->field('phone');
$show->field('identity');
$show->field('created_at');
$show->field('updated_at');
});
}

protected function form(): Form
{
return Form::make(new User(), function (Form $form) {
$form->display('id');
$form->text('name')->required();
$form->text('name');
$form->mobile('phone')->required();
$form->text('identity')->required();

$form->text('identity')->prepend('<i class="fa fa-id-card-o"></i>');
$form->display('created_at');
$form->display('updated_at');
});
Expand Down
2 changes: 1 addition & 1 deletion app/Admin/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

$router->get('/', 'HomeController@index');
$router->resource('sms_templates', 'SmsTemplatesController', ['except' => ['show'] ]); // 短信模版
$router->resource('users', 'UsersController'); // 用户列表
$router->resource('users', 'UsersController', ['except' => ['show'] ]); // 用户列表
});

0 comments on commit c472a41

Please sign in to comment.