@@ -33,7 +33,7 @@ |
||
33 | 33 | * |
34 | 34 | * @param int $id |
35 | 35 | * |
36 | - * @return \Illuminate\Http\Response |
|
36 | + * @return \Illuminate\Http\JsonResponse |
|
37 | 37 | */ |
38 | 38 | public function destroy($id) |
39 | 39 | { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function index() |
24 | 24 | { |
25 | - return Admin::content(function (Content $content) { |
|
25 | + return Admin::content(function(Content $content) { |
|
26 | 26 | $content->header(trans('admin.administrator')); |
27 | 27 | $content->description(trans('admin.list')); |
28 | 28 | $content->body($this->grid()->render()); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function edit($id) |
40 | 40 | { |
41 | - return Admin::content(function (Content $content) use ($id) { |
|
41 | + return Admin::content(function(Content $content) use ($id) { |
|
42 | 42 | $content->header(trans('admin.administrator')); |
43 | 43 | $content->description(trans('admin.edit')); |
44 | 44 | $content->body($this->form()->edit($id)); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function create() |
54 | 54 | { |
55 | - return Admin::content(function (Content $content) { |
|
55 | + return Admin::content(function(Content $content) { |
|
56 | 56 | $content->header(trans('admin.administrator')); |
57 | 57 | $content->description(trans('admin.create')); |
58 | 58 | $content->body($this->form()); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | protected function grid() |
68 | 68 | { |
69 | - return Administrator::grid(function (Grid $grid) { |
|
69 | + return Administrator::grid(function(Grid $grid) { |
|
70 | 70 | $grid->id('ID')->sortable(); |
71 | 71 | $grid->username(trans('admin.username')); |
72 | 72 | $grid->name(trans('admin.name')); |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | $grid->created_at(trans('admin.created_at')); |
75 | 75 | $grid->updated_at(trans('admin.updated_at')); |
76 | 76 | |
77 | - $grid->actions(function (Grid\Displayers\Actions $actions) { |
|
77 | + $grid->actions(function(Grid\Displayers\Actions $actions) { |
|
78 | 78 | if ($actions->getKey() == 1) { |
79 | 79 | $actions->disableDelete(); |
80 | 80 | } |
81 | 81 | }); |
82 | 82 | |
83 | - $grid->tools(function (Grid\Tools $tools) { |
|
84 | - $tools->batch(function (Grid\Tools\BatchActions $actions) { |
|
83 | + $grid->tools(function(Grid\Tools $tools) { |
|
84 | + $tools->batch(function(Grid\Tools\BatchActions $actions) { |
|
85 | 85 | $actions->disableDelete(); |
86 | 86 | }); |
87 | 87 | }); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function form() |
97 | 97 | { |
98 | - return Administrator::form(function (Form $form) { |
|
98 | + return Administrator::form(function(Form $form) { |
|
99 | 99 | $form->display('id', 'ID'); |
100 | 100 | |
101 | 101 | $form->text('username', trans('admin.username'))->rules('required'); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $form->image('avatar', trans('admin.avatar')); |
104 | 104 | $form->password('password', trans('admin.password'))->rules('required|confirmed'); |
105 | 105 | $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required') |
106 | - ->default(function ($form) { |
|
106 | + ->default(function($form) { |
|
107 | 107 | return $form->model()->password; |
108 | 108 | }); |
109 | 109 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $form->display('created_at', trans('admin.created_at')); |
116 | 116 | $form->display('updated_at', trans('admin.updated_at')); |
117 | 117 | |
118 | - $form->saving(function (Form $form) { |
|
118 | + $form->saving(function(Form $form) { |
|
119 | 119 | if ($form->password && $form->model()->password != $form->password) { |
120 | 120 | $form->password = bcrypt($form->password); |
121 | 121 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function update($id) |
134 | 134 | { |
135 | - if($id == 1 && Admin::user()->id != 1){ |
|
135 | + if ($id == 1 && Admin::user()->id != 1) { |
|
136 | 136 | return back(); |
137 | 137 | } |
138 | 138 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | public function destroy($id) |
150 | 150 | { |
151 | 151 | $ids = explode(',', $id); |
152 | - if(in_array(1, $ids)){ |
|
152 | + if (in_array(1, $ids)) { |
|
153 | 153 | return response()->json([ |
154 | 154 | 'status' => false, |
155 | 155 | 'message' => trans('admin.delete_failed'), |