@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create(config('admin.database.users_table'), function (Blueprint $table) { |
|
15 | + Schema::create(config('admin.database.users_table'), function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('username', 190)->unique(); |
18 | 18 | $table->string('password', 60); |
@@ -21,21 +21,21 @@ discard block |
||
21 | 21 | $table->timestamps(); |
22 | 22 | }); |
23 | 23 | |
24 | - Schema::create(config('admin.database.roles_table'), function (Blueprint $table) { |
|
24 | + Schema::create(config('admin.database.roles_table'), function(Blueprint $table) { |
|
25 | 25 | $table->increments('id'); |
26 | 26 | $table->string('name', 50)->unique(); |
27 | 27 | $table->string('slug', 50); |
28 | 28 | $table->timestamps(); |
29 | 29 | }); |
30 | 30 | |
31 | - Schema::create(config('admin.database.permissions_table'), function (Blueprint $table) { |
|
31 | + Schema::create(config('admin.database.permissions_table'), function(Blueprint $table) { |
|
32 | 32 | $table->increments('id'); |
33 | 33 | $table->string('name', 50)->unique(); |
34 | 34 | $table->string('slug', 50); |
35 | 35 | $table->timestamps(); |
36 | 36 | }); |
37 | 37 | |
38 | - Schema::create(config('admin.database.menu_table'), function (Blueprint $table) { |
|
38 | + Schema::create(config('admin.database.menu_table'), function(Blueprint $table) { |
|
39 | 39 | $table->increments('id'); |
40 | 40 | $table->integer('parent_id')->default(0); |
41 | 41 | $table->integer('order'); |
@@ -46,28 +46,28 @@ discard block |
||
46 | 46 | $table->timestamps(); |
47 | 47 | }); |
48 | 48 | |
49 | - Schema::create(config('admin.database.role_users_table'), function (Blueprint $table) { |
|
49 | + Schema::create(config('admin.database.role_users_table'), function(Blueprint $table) { |
|
50 | 50 | $table->integer('role_id'); |
51 | 51 | $table->integer('user_id'); |
52 | 52 | $table->index(['role_id', 'user_id']); |
53 | 53 | $table->timestamps(); |
54 | 54 | }); |
55 | 55 | |
56 | - Schema::create(config('admin.database.role_permissions_table'), function (Blueprint $table) { |
|
56 | + Schema::create(config('admin.database.role_permissions_table'), function(Blueprint $table) { |
|
57 | 57 | $table->integer('role_id'); |
58 | 58 | $table->integer('permission_id'); |
59 | 59 | $table->index(['role_id', 'permission_id']); |
60 | 60 | $table->timestamps(); |
61 | 61 | }); |
62 | 62 | |
63 | - Schema::create(config('admin.database.role_menu_table'), function (Blueprint $table) { |
|
63 | + Schema::create(config('admin.database.role_menu_table'), function(Blueprint $table) { |
|
64 | 64 | $table->integer('role_id'); |
65 | 65 | $table->integer('menu_id'); |
66 | 66 | $table->index(['role_id', 'menu_id']); |
67 | 67 | $table->timestamps(); |
68 | 68 | }); |
69 | 69 | |
70 | - Schema::create(config('admin.database.operation_log_table'), function (Blueprint $table) { |
|
70 | + Schema::create(config('admin.database.operation_log_table'), function(Blueprint $table) { |
|
71 | 71 | $table->increments('id'); |
72 | 72 | $table->integer('user_id'); |
73 | 73 | $table->string('path'); |
@@ -18,18 +18,18 @@ discard block |
||
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 | |
23 | 23 | $content->header(trans('admin::lang.operation_log')); |
24 | 24 | $content->description(trans('admin::lang.list')); |
25 | 25 | |
26 | - $grid = Admin::grid(OperationLog::class, function (Grid $grid) { |
|
26 | + $grid = Admin::grid(OperationLog::class, function(Grid $grid) { |
|
27 | 27 | |
28 | 28 | $grid->model()->orderBy('id', 'DESC'); |
29 | 29 | |
30 | 30 | $grid->id('ID')->sortable(); |
31 | 31 | $grid->user()->name(); |
32 | - $grid->method()->value(function ($method) { |
|
32 | + $grid->method()->value(function($method) { |
|
33 | 33 | |
34 | 34 | $color = array_get(OperationLog::$methodColors, $method, 'grey'); |
35 | 35 | return "<span class=\"badge bg-$color\">$method</span>"; |
@@ -37,21 +37,21 @@ discard block |
||
37 | 37 | }); |
38 | 38 | $grid->path()->label('info'); |
39 | 39 | $grid->ip()->label('primary'); |
40 | - $grid->input()->value(function ($input) { |
|
40 | + $grid->input()->value(function($input) { |
|
41 | 41 | |
42 | 42 | $input = json_decode($input, true); |
43 | 43 | $input = array_except($input, '_pjax'); |
44 | 44 | |
45 | - return '<code>'.json_encode($input, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE).'</code>'; |
|
45 | + return '<code>'.json_encode($input, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE).'</code>'; |
|
46 | 46 | }); |
47 | 47 | |
48 | 48 | $grid->created_at(trans('admin::lang.created_at')); |
49 | 49 | |
50 | - $grid->rows(function ($row) { |
|
50 | + $grid->rows(function($row) { |
|
51 | 51 | $row->actions('delete'); |
52 | 52 | }); |
53 | 53 | |
54 | - $grid->filter(function ($filter) { |
|
54 | + $grid->filter(function($filter) { |
|
55 | 55 | |
56 | 56 | $filter->is('user_id', 'User')->select(Administrator::all()->pluck('name', 'id')); |
57 | 57 | $filter->is('method')->select(array_combine(OperationLog::$methods, OperationLog::$methods)); |