@@ -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 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | { |
197 | 197 | static::$branchOrder = array_flip(array_flatten($order)); |
198 | 198 | |
199 | - static::$branchOrder = array_map(function ($item) { |
|
199 | + static::$branchOrder = array_map(function($item) { |
|
200 | 200 | return ++$item; |
201 | 201 | }, static::$branchOrder); |
202 | 202 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | { |
291 | 291 | parent::boot(); |
292 | 292 | |
293 | - static::saving(function (Model $branch) { |
|
293 | + static::saving(function(Model $branch) { |
|
294 | 294 | $parentColumn = $branch->getParentColumn(); |
295 | 295 | |
296 | 296 | if (Request::has($parentColumn) && Request::input($parentColumn) == $branch->getKey()) { |
@@ -103,7 +103,7 @@ |
||
103 | 103 | protected function initBranchCallback() |
104 | 104 | { |
105 | 105 | if (is_null($this->branchCallback)) { |
106 | - $this->branchCallback = function ($branch) { |
|
106 | + $this->branchCallback = function($branch) { |
|
107 | 107 | $key = $branch[$this->model->getKeyName()]; |
108 | 108 | $title = $branch[$this->model->getTitleColumn()]; |
109 | 109 |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | $callback = $this->actionsCallback; |
435 | 435 | $column = $this->addColumn('__actions__', trans('admin.action')); |
436 | 436 | |
437 | - $column->display(function ($value) use ($grid, $column, $callback) { |
|
437 | + $column->display(function($value) use ($grid, $column, $callback) { |
|
438 | 438 | $actions = new Actions($value, $grid, $column, $this); |
439 | 439 | |
440 | 440 | return $actions->display($callback); |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | */ |
449 | 449 | public function disableRowSelector() |
450 | 450 | { |
451 | - $this->tools(function ($tools) { |
|
451 | + $this->tools(function($tools) { |
|
452 | 452 | /* @var Grid\Tools $tools */ |
453 | 453 | $tools->disableBatchActions(); |
454 | 454 | }); |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $column = new Column(Column::SELECT_COLUMN_NAME, ' '); |
473 | 473 | $column->setGrid($this); |
474 | 474 | |
475 | - $column->display(function ($value) use ($grid, $column) { |
|
475 | + $column->display(function($value) use ($grid, $column) { |
|
476 | 476 | $actions = new RowSelector($value, $grid, $column, $this); |
477 | 477 | |
478 | 478 | return $actions->display(); |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | |
500 | 500 | Column::setOriginalGridData($data); |
501 | 501 | |
502 | - $this->columns->map(function (Column $column) use (&$data) { |
|
502 | + $this->columns->map(function(Column $column) use (&$data) { |
|
503 | 503 | $data = $column->fill($data); |
504 | 504 | |
505 | 505 | $this->columnNames[] = $column->getName(); |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | */ |
578 | 578 | protected function buildRows(array $data) |
579 | 579 | { |
580 | - $this->rows = collect($data)->map(function ($model, $number) { |
|
580 | + $this->rows = collect($data)->map(function($model, $number) { |
|
581 | 581 | return new Row($number, $model); |
582 | 582 | }); |
583 | 583 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | { |
15 | 15 | $connection = config('admin.database.connection') ?: config('database.default'); |
16 | 16 | |
17 | - Schema::connection($connection)->create(config('admin.database.users_table'), function (Blueprint $table) { |
|
17 | + Schema::connection($connection)->create(config('admin.database.users_table'), function(Blueprint $table) { |
|
18 | 18 | $table->increments('id'); |
19 | 19 | $table->string('username', 190)->unique(); |
20 | 20 | $table->string('password', 60); |
@@ -23,21 +23,21 @@ discard block |
||
23 | 23 | $table->timestamps(); |
24 | 24 | }); |
25 | 25 | |
26 | - Schema::connection($connection)->create(config('admin.database.roles_table'), function (Blueprint $table) { |
|
26 | + Schema::connection($connection)->create(config('admin.database.roles_table'), function(Blueprint $table) { |
|
27 | 27 | $table->increments('id'); |
28 | 28 | $table->string('name', 50)->unique(); |
29 | 29 | $table->string('slug', 50); |
30 | 30 | $table->timestamps(); |
31 | 31 | }); |
32 | 32 | |
33 | - Schema::connection($connection)->create(config('admin.database.permissions_table'), function (Blueprint $table) { |
|
33 | + Schema::connection($connection)->create(config('admin.database.permissions_table'), function(Blueprint $table) { |
|
34 | 34 | $table->increments('id'); |
35 | 35 | $table->string('name', 50)->unique(); |
36 | 36 | $table->string('slug', 50); |
37 | 37 | $table->timestamps(); |
38 | 38 | }); |
39 | 39 | |
40 | - Schema::connection($connection)->create(config('admin.database.menu_table'), function (Blueprint $table) { |
|
40 | + Schema::connection($connection)->create(config('admin.database.menu_table'), function(Blueprint $table) { |
|
41 | 41 | $table->increments('id'); |
42 | 42 | $table->integer('parent_id')->default(0); |
43 | 43 | $table->integer('order')->default(0); |
@@ -48,35 +48,35 @@ discard block |
||
48 | 48 | $table->timestamps(); |
49 | 49 | }); |
50 | 50 | |
51 | - Schema::connection($connection)->create(config('admin.database.role_users_table'), function (Blueprint $table) { |
|
51 | + Schema::connection($connection)->create(config('admin.database.role_users_table'), function(Blueprint $table) { |
|
52 | 52 | $table->integer('role_id'); |
53 | 53 | $table->integer('user_id'); |
54 | 54 | $table->index(['role_id', 'user_id']); |
55 | 55 | $table->timestamps(); |
56 | 56 | }); |
57 | 57 | |
58 | - Schema::connection($connection)->create(config('admin.database.role_permissions_table'), function (Blueprint $table) { |
|
58 | + Schema::connection($connection)->create(config('admin.database.role_permissions_table'), function(Blueprint $table) { |
|
59 | 59 | $table->integer('role_id'); |
60 | 60 | $table->integer('permission_id'); |
61 | 61 | $table->index(['role_id', 'permission_id']); |
62 | 62 | $table->timestamps(); |
63 | 63 | }); |
64 | 64 | |
65 | - Schema::connection($connection)->create(config('admin.database.user_permissions_table'), function (Blueprint $table) { |
|
65 | + Schema::connection($connection)->create(config('admin.database.user_permissions_table'), function(Blueprint $table) { |
|
66 | 66 | $table->integer('user_id'); |
67 | 67 | $table->integer('permission_id'); |
68 | 68 | $table->index(['user_id', 'permission_id']); |
69 | 69 | $table->timestamps(); |
70 | 70 | }); |
71 | 71 | |
72 | - Schema::connection($connection)->create(config('admin.database.role_menu_table'), function (Blueprint $table) { |
|
72 | + Schema::connection($connection)->create(config('admin.database.role_menu_table'), function(Blueprint $table) { |
|
73 | 73 | $table->integer('role_id'); |
74 | 74 | $table->integer('menu_id'); |
75 | 75 | $table->index(['role_id', 'menu_id']); |
76 | 76 | $table->timestamps(); |
77 | 77 | }); |
78 | 78 | |
79 | - Schema::connection($connection)->create(config('admin.database.operation_log_table'), function (Blueprint $table) { |
|
79 | + Schema::connection($connection)->create(config('admin.database.operation_log_table'), function(Blueprint $table) { |
|
80 | 80 | $table->increments('id'); |
81 | 81 | $table->integer('user_id'); |
82 | 82 | $table->string('path'); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | @if($errors->hasBag('exception')) |
2 | - <?php $error = $errors->getBag('exception');?> |
|
2 | + <?php $error = $errors->getBag('exception'); ?> |
|
3 | 3 | <div class="alert alert-warning alert-dismissable"> |
4 | 4 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
5 | 5 | <h4> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | @if(Session::has('success')) |
2 | - <?php $success = Session::get('success');?> |
|
2 | + <?php $success = Session::get('success'); ?> |
|
3 | 3 | <div class="alert alert-success alert-dismissable"> |
4 | 4 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
5 | 5 | <h4><i class="icon fa fa-check"></i>{{ array_get($success->get('title'), 0) }}</h4> |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function index() |
23 | 23 | { |
24 | - return Admin::content(function (Content $content) { |
|
24 | + return Admin::content(function(Content $content) { |
|
25 | 25 | $content->header(trans('admin.permissions')); |
26 | 26 | $content->description(trans('admin.list')); |
27 | 27 | $content->body($this->grid()->render()); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function edit($id) |
39 | 39 | { |
40 | - return Admin::content(function (Content $content) use ($id) { |
|
40 | + return Admin::content(function(Content $content) use ($id) { |
|
41 | 41 | $content->header(trans('admin.permissions')); |
42 | 42 | $content->description(trans('admin.edit')); |
43 | 43 | $content->body($this->form()->edit($id)); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function create() |
53 | 53 | { |
54 | - return Admin::content(function (Content $content) { |
|
54 | + return Admin::content(function(Content $content) { |
|
55 | 55 | $content->header(trans('admin.permissions')); |
56 | 56 | $content->description(trans('admin.create')); |
57 | 57 | $content->body($this->form()); |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function grid() |
67 | 67 | { |
68 | - return Admin::grid(Permission::class, function (Grid $grid) { |
|
68 | + return Admin::grid(Permission::class, function(Grid $grid) { |
|
69 | 69 | $grid->id('ID')->sortable(); |
70 | 70 | $grid->slug(trans('admin.slug')); |
71 | 71 | $grid->name(trans('admin.name')); |
72 | 72 | |
73 | - $grid->http_path(trans('admin.route'))->display(function ($path) { |
|
74 | - return collect(explode("\r\n", $path))->map(function ($path) { |
|
73 | + $grid->http_path(trans('admin.route'))->display(function($path) { |
|
74 | + return collect(explode("\r\n", $path))->map(function($path) { |
|
75 | 75 | $method = $this->http_method ?: ['ANY']; |
76 | 76 | |
77 | 77 | if (Str::contains($path, ':')) { |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | $method = explode(',', $method); |
80 | 80 | } |
81 | 81 | |
82 | - $method = collect($method)->map(function ($name) { |
|
82 | + $method = collect($method)->map(function($name) { |
|
83 | 83 | return strtoupper($name); |
84 | - })->map(function ($name) { |
|
84 | + })->map(function($name) { |
|
85 | 85 | return "<span class='label label-primary'>{$name}</span>"; |
86 | 86 | })->implode(' '); |
87 | 87 | |
@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | $grid->created_at(trans('admin.created_at')); |
95 | 95 | $grid->updated_at(trans('admin.updated_at')); |
96 | 96 | |
97 | - $grid->tools(function (Grid\Tools $tools) { |
|
98 | - $tools->batch(function (Grid\Tools\BatchActions $actions) { |
|
97 | + $grid->tools(function(Grid\Tools $tools) { |
|
98 | + $tools->batch(function(Grid\Tools\BatchActions $actions) { |
|
99 | 99 | $actions->disableDelete(); |
100 | 100 | }); |
101 | 101 | }); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function form() |
111 | 111 | { |
112 | - return Admin::form(Permission::class, function (Form $form) { |
|
112 | + return Admin::form(Permission::class, function(Form $form) { |
|
113 | 113 | $form->display('id', 'ID'); |
114 | 114 | |
115 | 115 | $form->text('slug', trans('admin.slug'))->rules('required'); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | protected static function routes($callback) |
25 | 25 | { |
26 | 26 | /* @var \Illuminate\Routing\Router $router */ |
27 | - Route::group(['prefix' => config('admin.route.prefix')], function ($router) use ($callback) { |
|
27 | + Route::group(['prefix' => config('admin.route.prefix')], function($router) use ($callback) { |
|
28 | 28 | $attributes = array_merge([ |
29 | 29 | 'middleware' => config('admin.route.middleware'), |
30 | 30 | ], static::config('route', [])); |