@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | $app = require __DIR__.'/../vendor/laravel/laravel/bootstrap/app.php'; |
21 | 21 | |
22 | - $app->booting(function () { |
|
22 | + $app->booting(function() { |
|
23 | 23 | $loader = \Illuminate\Foundation\AliasLoader::getInstance(); |
24 | 24 | $loader->alias('Admin', \Encore\Admin\Facades\Admin::class); |
25 | 25 | }); |
@@ -73,13 +73,13 @@ |
||
73 | 73 | 'driver' => 'qiniu', |
74 | 74 | 'domains' => [ |
75 | 75 | 'default' => 'of8kfibjo.bkt.clouddn.com', //你的七牛域名 |
76 | - 'https' => 'dn-yourdomain.qbox.me', //你的HTTPS域名 |
|
77 | - 'custom' => 'static.abc.com', //你的自定义域名 |
|
76 | + 'https' => 'dn-yourdomain.qbox.me', //你的HTTPS域名 |
|
77 | + 'custom' => 'static.abc.com', //你的自定义域名 |
|
78 | 78 | ], |
79 | - 'access_key' => 'tIyz5h5IDT1-PQS22iRrI4dCBEktWj76O-ls856K', //AccessKey |
|
80 | - 'secret_key' => 'TCU2GuSlbzxKgnixYO_-pdo4odbXttm1RNNvEwSD', //SecretKey |
|
81 | - 'bucket' => 'laravel', //Bucket名字 |
|
82 | - 'notify_url' => '', //持久化处理回调地址 |
|
79 | + 'access_key' => 'tIyz5h5IDT1-PQS22iRrI4dCBEktWj76O-ls856K', //AccessKey |
|
80 | + 'secret_key' => 'TCU2GuSlbzxKgnixYO_-pdo4odbXttm1RNNvEwSD', //SecretKey |
|
81 | + 'bucket' => 'laravel', //Bucket名字 |
|
82 | + 'notify_url' => '', //持久化处理回调地址 |
|
83 | 83 | ], |
84 | 84 | |
85 | 85 | 'aliyun' => [ |
@@ -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('All users'); |
27 | 27 | $content->description('description'); |
28 | 28 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function edit($id) |
41 | 41 | { |
42 | - return Admin::content(function (Content $content) use ($id) { |
|
42 | + return Admin::content(function(Content $content) use ($id) { |
|
43 | 43 | $content->header('Edit user'); |
44 | 44 | $content->description('description'); |
45 | 45 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function create() |
56 | 56 | { |
57 | - return Admin::content(function (Content $content) { |
|
57 | + return Admin::content(function(Content $content) { |
|
58 | 58 | $content->header('Create user'); |
59 | 59 | |
60 | 60 | $content->body($this->form()); |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function grid() |
70 | 70 | { |
71 | - return Admin::grid(User::class, function (Grid $grid) { |
|
71 | + return Admin::grid(User::class, function(Grid $grid) { |
|
72 | 72 | $grid->id('ID')->sortable(); |
73 | 73 | |
74 | 74 | $grid->username(); |
75 | 75 | $grid->email(); |
76 | 76 | $grid->mobile(); |
77 | 77 | $grid->full_name(); |
78 | - $grid->avatar()->display(function ($avatar) { |
|
78 | + $grid->avatar()->display(function($avatar) { |
|
79 | 79 | return "<img src='{$avatar}' />"; |
80 | 80 | }); |
81 | 81 | $grid->profile()->postcode('Post code'); |
@@ -85,16 +85,16 @@ discard block |
||
85 | 85 | $grid->profile()->start_at('开始时间'); |
86 | 86 | $grid->profile()->end_at('结束时间'); |
87 | 87 | |
88 | - $grid->column('column1_not_in_table')->display(function () { |
|
88 | + $grid->column('column1_not_in_table')->display(function() { |
|
89 | 89 | return 'full name:'.$this->full_name; |
90 | 90 | }); |
91 | 91 | |
92 | - $grid->column('column2_not_in_table')->display(function () { |
|
92 | + $grid->column('column2_not_in_table')->display(function() { |
|
93 | 93 | return $this->email.'#'.$this->profile['color']; |
94 | 94 | }); |
95 | 95 | |
96 | - $grid->tags()->display(function ($tags) { |
|
97 | - $tags = collect($tags)->map(function ($tag) { |
|
96 | + $grid->tags()->display(function($tags) { |
|
97 | + $tags = collect($tags)->map(function($tag) { |
|
98 | 98 | return "<code>{$tag['name']}</code>"; |
99 | 99 | })->toArray(); |
100 | 100 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $grid->created_at(); |
105 | 105 | $grid->updated_at(); |
106 | 106 | |
107 | - $grid->filter(function ($filter) { |
|
107 | + $grid->filter(function($filter) { |
|
108 | 108 | $filter->like('username'); |
109 | 109 | $filter->like('email'); |
110 | 110 | $filter->like('profile.postcode'); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $filter->between('profile.end_at')->datetime(); |
113 | 113 | }); |
114 | 114 | |
115 | - $grid->actions(function ($actions) { |
|
115 | + $grid->actions(function($actions) { |
|
116 | 116 | if ($actions->getKey() % 2 == 0) { |
117 | 117 | $actions->append('<a href="/" class="btn btn-xs btn-danger">detail</a>'); |
118 | 118 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | Form::extend('map', Form\Field\Map::class); |
131 | 131 | Form::extend('editor', Form\Field\Editor::class); |
132 | 132 | |
133 | - return Admin::form(User::class, function (Form $form) { |
|
133 | + return Admin::form(User::class, function(Form $form) { |
|
134 | 134 | $form->disableDeletion(); |
135 | 135 | |
136 | 136 | $form->display('id', 'ID'); |
@@ -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('header'); |
26 | 26 | $content->description('description'); |
27 | 27 | |
@@ -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('header'); |
43 | 43 | $content->description('description'); |
44 | 44 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function create() |
55 | 55 | { |
56 | - return Admin::content(function (Content $content) { |
|
56 | + return Admin::content(function(Content $content) { |
|
57 | 57 | $content->header('Upload image'); |
58 | 58 | |
59 | 59 | $content->body($this->form()); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | protected function grid() |
69 | 69 | { |
70 | - return Admin::grid(Image::class, function (Grid $grid) { |
|
70 | + return Admin::grid(Image::class, function(Grid $grid) { |
|
71 | 71 | $grid->id('ID')->sortable(); |
72 | 72 | |
73 | 73 | $grid->created_at(); |
@@ -84,14 +84,14 @@ discard block |
||
84 | 84 | */ |
85 | 85 | protected function form() |
86 | 86 | { |
87 | - return Admin::form(Image::class, function (Form $form) { |
|
87 | + return Admin::form(Image::class, function(Form $form) { |
|
88 | 88 | $form->display('id', 'ID'); |
89 | 89 | |
90 | 90 | $form->image('image1'); |
91 | 91 | $form->image('image2')->rotate(90); |
92 | 92 | $form->image('image3')->flip('v'); |
93 | 93 | $form->image('image4')->move(null, 'renamed.jpeg'); |
94 | - $form->image('image5')->name(function ($file) { |
|
94 | + $form->image('image5')->name(function($file) { |
|
95 | 95 | return 'asdasdasdasdasd.'.$file->guessExtension(); |
96 | 96 | }); |
97 | 97 | $form->image('image6')->uniqueName(); |
@@ -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('header'); |
26 | 26 | $content->description('description'); |
27 | 27 | |
@@ -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('header'); |
43 | 43 | $content->description('description'); |
44 | 44 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function create() |
55 | 55 | { |
56 | - return Admin::content(function (Content $content) { |
|
56 | + return Admin::content(function(Content $content) { |
|
57 | 57 | $content->header('Upload image'); |
58 | 58 | |
59 | 59 | $content->body($this->form()); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | protected function grid() |
69 | 69 | { |
70 | - return Admin::grid(Image::class, function (Grid $grid) { |
|
70 | + return Admin::grid(Image::class, function(Grid $grid) { |
|
71 | 71 | $grid->id('ID')->sortable(); |
72 | 72 | |
73 | 73 | $grid->created_at(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | protected function form() |
86 | 86 | { |
87 | - return Admin::form(MultipleImage::class, function (Form $form) { |
|
87 | + return Admin::form(MultipleImage::class, function(Form $form) { |
|
88 | 88 | $form->display('id', 'ID'); |
89 | 89 | |
90 | 90 | $form->multipleImage('pictures'); |
@@ -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('header'); |
26 | 26 | $content->description('description'); |
27 | 27 | |
@@ -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('header'); |
43 | 43 | $content->description('description'); |
44 | 44 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function create() |
55 | 55 | { |
56 | - return Admin::content(function (Content $content) { |
|
56 | + return Admin::content(function(Content $content) { |
|
57 | 57 | $content->header('Upload file'); |
58 | 58 | |
59 | 59 | $content->body($this->form()); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | protected function grid() |
69 | 69 | { |
70 | - return Admin::grid(File::class, function (Grid $grid) { |
|
70 | + return Admin::grid(File::class, function(Grid $grid) { |
|
71 | 71 | $grid->id('ID')->sortable(); |
72 | 72 | |
73 | 73 | $grid->created_at(); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | protected function form() |
84 | 84 | { |
85 | - return Admin::form(File::class, function (Form $form) { |
|
85 | + return Admin::form(File::class, function(Form $form) { |
|
86 | 86 | $form->display('id', 'ID'); |
87 | 87 | |
88 | 88 | $form->file('file1'); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | 'prefix' => config('admin.route.prefix'), |
5 | 5 | 'namespace' => 'Tests\Controllers', |
6 | 6 | 'middleware' => ['web', 'admin'], |
7 | -], function ($router) { |
|
7 | +], function($router) { |
|
8 | 8 | $router->resource('images', ImageController::class); |
9 | 9 | $router->resource('multiple-images', MultipleImageController::class); |
10 | 10 | $router->resource('files', FileController::class); |
@@ -103,7 +103,7 @@ |
||
103 | 103 | { |
104 | 104 | factory(\Tests\Models\User::class, $count) |
105 | 105 | ->create() |
106 | - ->each(function ($u) { |
|
106 | + ->each(function($u) { |
|
107 | 107 | $u->profile()->save(factory(\Tests\Models\Profile::class)->make()); |
108 | 108 | $u->tags()->saveMany(factory(\Tests\Models\Tag::class, 5)->make()); |
109 | 109 | }); |