Completed
Pull Request — master (#2014)
by Song
02:47
created
src/Form/EmbeddedForm.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      */
162 162
     protected function prepareValue($key, $record)
163 163
     {
164
-        $field = $this->fields->first(function (Field $field) use ($key) {
164
+        $field = $this->fields->first(function(Field $field) use ($key) {
165 165
             return in_array($key, (array) $field->column());
166 166
         });
167 167
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         if (array_key_exists($key, $this->original)) {
185 185
             $values = $this->original[$key];
186 186
 
187
-            $this->fields->each(function (Field $field) use ($values) {
187
+            $this->fields->each(function(Field $field) use ($values) {
188 188
                 $field->setOriginal($values);
189 189
             });
190 190
         }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      */
200 200
     public function fill(array $data)
201 201
     {
202
-        $this->fields->each(function (Field $field) use ($data) {
202
+        $this->fields->each(function(Field $field) use ($data) {
203 203
             $field->fill($data);
204 204
         });
205 205
 
Please login to merge, or discard this patch.
src/Form/Tab.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
     public function getTabs()
83 83
     {
84 84
         // If there is no active tab, then active the first.
85
-        if ($this->tabs->filter(function ($tab) {
85
+        if ($this->tabs->filter(function($tab) {
86 86
             return $tab['active'];
87 87
         })->isEmpty()) {
88 88
             $first = $this->tabs->first();
Please login to merge, or discard this patch.
src/Controllers/RoleController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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.roles'));
26 26
             $content->description(trans('admin.list'));
27 27
             $content->body($this->grid()->render());
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
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.roles'));
42 42
             $content->description(trans('admin.edit'));
43 43
             $content->body($this->form()->edit($id));
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
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.roles'));
56 56
             $content->description(trans('admin.create'));
57 57
             $content->body($this->form());
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     protected function grid()
67 67
     {
68
-        return Admin::grid(Role::class, function (Grid $grid) {
68
+        return Admin::grid(Role::class, function(Grid $grid) {
69 69
             $grid->id('ID')->sortable();
70 70
             $grid->slug(trans('admin.slug'));
71 71
             $grid->name(trans('admin.name'));
@@ -75,14 +75,14 @@  discard block
 block discarded – undo
75 75
             $grid->created_at(trans('admin.created_at'));
76 76
             $grid->updated_at(trans('admin.updated_at'));
77 77
 
78
-            $grid->actions(function (Grid\Displayers\Actions $actions) {
78
+            $grid->actions(function(Grid\Displayers\Actions $actions) {
79 79
                 if ($actions->row->slug == 'administrator') {
80 80
                     $actions->disableDelete();
81 81
                 }
82 82
             });
83 83
 
84
-            $grid->tools(function (Grid\Tools $tools) {
85
-                $tools->batch(function (Grid\Tools\BatchActions $actions) {
84
+            $grid->tools(function(Grid\Tools $tools) {
85
+                $tools->batch(function(Grid\Tools\BatchActions $actions) {
86 86
                     $actions->disableDelete();
87 87
                 });
88 88
             });
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public function form()
98 98
     {
99
-        return Admin::form(Role::class, function (Form $form) {
99
+        return Admin::form(Role::class, function(Form $form) {
100 100
             $form->display('id', 'ID');
101 101
 
102 102
             $form->text('slug', trans('admin.slug'))->rules('required');
Please login to merge, or discard this patch.
src/Controllers/LogController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,23 +18,23 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function index()
20 20
     {
21
-        return Admin::content(function (Content $content) {
21
+        return Admin::content(function(Content $content) {
22 22
             $content->header(trans('admin.operation_log'));
23 23
             $content->description(trans('admin.list'));
24 24
 
25
-            $grid = Admin::grid(OperationLog::class, function (Grid $grid) {
25
+            $grid = Admin::grid(OperationLog::class, function(Grid $grid) {
26 26
                 $grid->model()->orderBy('id', 'DESC');
27 27
 
28 28
                 $grid->id('ID')->sortable();
29 29
                 $grid->user()->name('User');
30
-                $grid->method()->display(function ($method) {
30
+                $grid->method()->display(function($method) {
31 31
                     $color = array_get(OperationLog::$methodColors, $method, 'grey');
32 32
 
33 33
                     return "<span class=\"badge bg-$color\">$method</span>";
34 34
                 });
35 35
                 $grid->path()->label('info');
36 36
                 $grid->ip()->label('primary');
37
-                $grid->input()->display(function ($input) {
37
+                $grid->input()->display(function($input) {
38 38
                     $input = json_decode($input, true);
39 39
                     $input = array_except($input, ['_pjax', '_token', '_method', '_previous_']);
40 40
                     if (empty($input)) {
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 
47 47
                 $grid->created_at(trans('admin.created_at'));
48 48
 
49
-                $grid->actions(function (Grid\Displayers\Actions $actions) {
49
+                $grid->actions(function(Grid\Displayers\Actions $actions) {
50 50
                     $actions->disableEdit();
51 51
                 });
52 52
 
53 53
                 $grid->disableCreation();
54 54
 
55
-                $grid->filter(function ($filter) {
55
+                $grid->filter(function($filter) {
56 56
                     $filter->equal('user_id', 'User')->select(Administrator::all()->pluck('name', 'id'));
57 57
                     $filter->equal('method')->select(array_combine(OperationLog::$methods, OperationLog::$methods));
58 58
                     $filter->like('path');
Please login to merge, or discard this patch.
src/Controllers/MenuController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function index()
26 26
     {
27
-        return Admin::content(function (Content $content) {
27
+        return Admin::content(function(Content $content) {
28 28
             $content->header(trans('admin.menu'));
29 29
             $content->description(trans('admin.list'));
30 30
 
31
-            $content->row(function (Row $row) {
31
+            $content->row(function(Row $row) {
32 32
                 $row->column(6, $this->treeView()->render());
33 33
 
34
-                $row->column(6, function (Column $column) {
34
+                $row->column(6, function(Column $column) {
35 35
                     $form = new \Encore\Admin\Widgets\Form();
36 36
                     $form->action(admin_base_path('auth/menu'));
37 37
 
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
      */
67 67
     protected function treeView()
68 68
     {
69
-        return Menu::tree(function (Tree $tree) {
69
+        return Menu::tree(function(Tree $tree) {
70 70
             $tree->disableCreate();
71 71
 
72
-            $tree->branch(function ($branch) {
72
+            $tree->branch(function($branch) {
73 73
                 $payload = "<i class='fa {$branch['icon']}'></i>&nbsp;<strong>{$branch['title']}</strong>";
74 74
 
75 75
                 if (!isset($branch['children'])) {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function edit($id)
94 94
     {
95
-        return Admin::content(function (Content $content) use ($id) {
95
+        return Admin::content(function(Content $content) use ($id) {
96 96
             $content->header(trans('admin.menu'));
97 97
             $content->description(trans('admin.edit'));
98 98
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function form()
109 109
     {
110
-        return Menu::form(function (Form $form) {
110
+        return Menu::form(function(Form $form) {
111 111
             $form->display('id', 'ID');
112 112
 
113 113
             $form->select('parent_id', trans('admin.parent_id'))->options(Menu::selectOptions());
Please login to merge, or discard this patch.
src/Controllers/UserController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                 }
Please login to merge, or discard this patch.
src/Grid.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      * Get or set option for grid.
229 229
      *
230 230
      * @param string $key
231
-     * @param mixed  $value
231
+     * @param boolean  $value
232 232
      *
233 233
      * @return $this|mixed
234 234
      */
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
     /**
359 359
      * Get the grid paginator.
360 360
      *
361
-     * @return mixed
361
+     * @return Tools\Paginator
362 362
      */
363 363
     public function paginator()
364 364
     {
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
      *
723 723
      * @param Closure|null $closure
724 724
      *
725
-     * @return $this|Tools\Footer
725
+     * @return callable
726 726
      */
727 727
     public function footer(Closure $closure = null)
728 728
     {
Please login to merge, or discard this patch.
database/migrations/2016_01_04_173148_create_admin_tables.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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');
Please login to merge, or discard this patch.
resources/views/partials/exception.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.