@@ -17,13 +17,13 @@ |
||
17 | 17 | |
18 | 18 | $total = $this->createModel()->count(); |
19 | 19 | $signedLastWeek = $this->createModel() |
20 | - ->where('created_at', '>=', $weekAgo)->count(); |
|
20 | + ->where('created_at', '>=', $weekAgo)->count(); |
|
21 | 21 | $signedLastMonth = $this->createModel() |
22 | - ->where('created_at', '>=', $monthAgo)->count(); |
|
22 | + ->where('created_at', '>=', $monthAgo)->count(); |
|
23 | 23 | $signedStatistics = $this->createModel() |
24 | - ->where('created_at', '>=', $monthAgo) |
|
25 | - ->select([DB::raw('COUNT(id) AS cnt'), DB::raw('DATE(created_at) as dt')]) |
|
26 | - ->groupBy('dt')->pluck('cnt', 'dt'); |
|
24 | + ->where('created_at', '>=', $monthAgo) |
|
25 | + ->select([DB::raw('COUNT(id) AS cnt'), DB::raw('DATE(created_at) as dt')]) |
|
26 | + ->groupBy('dt')->pluck('cnt', 'dt'); |
|
27 | 27 | |
28 | 28 | return view(app('scaffold.template')->dashboard('members'), [ |
29 | 29 | 'total' => $total, |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function indexedColumns($table) |
30 | 30 | { |
31 | - return Cache::remember("{$table}_indexed_columns", $this->lifetime(), function () use ($table) { |
|
32 | - $indexedColumns = array_reduce($this->indexes($table), function ($indexedColumns, $index) { |
|
31 | + return Cache::remember("{$table}_indexed_columns", $this->lifetime(), function() use ($table) { |
|
32 | + $indexedColumns = array_reduce($this->indexes($table), function($indexedColumns, $index) { |
|
33 | 33 | return array_merge($indexedColumns, $index->getColumns()); |
34 | 34 | }, []); |
35 | 35 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function indexes($table) |
48 | 48 | { |
49 | - return Cache::remember("{$table}_indexes", $this->lifetime(), function () use ($table) { |
|
49 | + return Cache::remember("{$table}_indexes", $this->lifetime(), function() use ($table) { |
|
50 | 50 | return $this->manager->listTableIndexes($table); |
51 | 51 | }); |
52 | 52 | } |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function columns($table) |
62 | 62 | { |
63 | - return Cache::remember("{$table}_columns", $this->lifetime(), function () use ($table) { |
|
63 | + return Cache::remember("{$table}_columns", $this->lifetime(), function() use ($table) { |
|
64 | 64 | $columns = $this->manager->listTableColumns($table); |
65 | 65 | $keys = array_keys($columns); |
66 | 66 | $vals = array_values($columns); |
67 | 67 | |
68 | - $keys = array_map(function ($key) { |
|
68 | + $keys = array_map(function($key) { |
|
69 | 69 | return trim(str_replace(['`', '"'], '', $key)); |
70 | 70 | }, $keys); |
71 | 71 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function foreignKeys($table) |
84 | 84 | { |
85 | - return Cache::remember("{$table}_foreign_keys", $this->lifetime(), function () use ($table) { |
|
85 | + return Cache::remember("{$table}_foreign_keys", $this->lifetime(), function() use ($table) { |
|
86 | 86 | return $this->manager->listTableForeignKeys($table); |
87 | 87 | }); |
88 | 88 | } |
@@ -79,7 +79,7 @@ |
||
79 | 79 | <tr> |
80 | 80 | <td> |
81 | 81 | <?php |
82 | - $parts = array_map(function ($part) { |
|
82 | + $parts = array_map(function($part) { |
|
83 | 83 | return title_case(str_replace(['_', '-'], ' ', $part)); |
84 | 84 | }, explode('.', $key)); |
85 | 85 | ?> |
@@ -3,7 +3,7 @@ |
||
3 | 3 | $elements = $filter->filters(); |
4 | 4 | $resetUrl = method_exists($module, 'defaultRoute') ? $module->defaultRoute() : route('scaffold.index', ['module' => $module]); |
5 | 5 | |
6 | -$filled = $elements ? $elements->reduce(function ($filled, $element) { |
|
6 | +$filled = $elements ? $elements->reduce(function($filled, $element) { |
|
7 | 7 | if ($element->getInput()->getValue()) { |
8 | 8 | ++$filled; |
9 | 9 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | 'prefix' => config('administrator.prefix', 'cms'), |
7 | 7 | 'namespace' => 'Terranet\Administrator\Controllers', |
8 | 8 | 'middleware' => ['web'], |
9 | -], function () use ($pattern) { |
|
9 | +], function() use ($pattern) { |
|
10 | 10 | /* |
11 | 11 | |------------------------------------------------------- |
12 | 12 | | Authentication |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | | Main Scaffolding routes |
28 | 28 | |------------------------------------------------------- |
29 | 29 | */ |
30 | - Route::group([], function () use ($pattern) { |
|
30 | + Route::group([], function() use ($pattern) { |
|
31 | 31 | /* |
32 | 32 | |------------------------------------------------------- |
33 | 33 | | Custom routes |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 'as' => 'scaffold', |
58 | 58 | ]); |
59 | 59 | |
60 | - Route::group(['prefix' => 'media'], function () { |
|
60 | + Route::group(['prefix' => 'media'], function() { |
|
61 | 61 | Route::get('/', [ |
62 | 62 | 'as' => 'scaffold.media', |
63 | 63 | 'uses' => 'MediaController@index', |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | protected function makeSidebar() |
32 | 32 | { |
33 | - $this->navigation->create(Navigable::MENU_SIDEBAR, function (MenuBuilder $sidebar) { |
|
33 | + $this->navigation->create(Navigable::MENU_SIDEBAR, function(MenuBuilder $sidebar) { |
|
34 | 34 | $sidebar->header('Main Menu'); |
35 | 35 | |
36 | 36 | // Dashboard |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ]); |
42 | 42 | |
43 | 43 | // Create new users group |
44 | - $sidebar->dropdown(trans('administrator::module.groups.users'), function (MenuItem $sub) { |
|
44 | + $sidebar->dropdown(trans('administrator::module.groups.users'), function(MenuItem $sub) { |
|
45 | 45 | $sub->route('scaffold.create', trans('administrator::buttons.create_item', ['resource' => 'User']), ['module' => 'users'], 1, []); |
46 | 46 | }, 2, ['id' => 'groups', 'icon' => 'fa fa-group']); |
47 | 47 | }); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | protected function makeTools() |
51 | 51 | { |
52 | - $this->navigation->create(Navigable::MENU_TOOLS, function (MenuBuilder $tools) { |
|
52 | + $this->navigation->create(Navigable::MENU_TOOLS, function(MenuBuilder $tools) { |
|
53 | 53 | if (app('scaffold.config')->get('file_manager')) { |
54 | 54 | $tools->url( |
55 | 55 | route('scaffold.media'), |
@@ -16,13 +16,13 @@ |
||
16 | 16 | protected function registerPanels() |
17 | 17 | { |
18 | 18 | $this->dashboard |
19 | - ->row(function (DashboardRow $row) { |
|
19 | + ->row(function(DashboardRow $row) { |
|
20 | 20 | $row->panel(new BlankPanel())->setWidth(12); |
21 | 21 | }) |
22 | 22 | // ->row(function (DashboardRow $row) { |
23 | 23 | // $row->panel(new GoogleAnalyticsPanel)->setWidth(12); |
24 | 24 | // }) |
25 | - ->row(function (DashboardRow $row) { |
|
25 | + ->row(function(DashboardRow $row) { |
|
26 | 26 | $row->panel(new MembersPanel())->setWidth(6); |
27 | 27 | $row->panel(new DatabasePanel())->setWidth(6); |
28 | 28 | }); |
@@ -173,8 +173,8 @@ |
||
173 | 173 | |
174 | 174 | $searchTerm = $request->get('query'); |
175 | 175 | $instance = (new $searchable)->where('id', (int) $searchTerm) |
176 | - ->orWhere($titleField, 'LIKE', "%{$request->get('query')}%") |
|
177 | - ->get(['id', "{$titleField} as name"]); |
|
176 | + ->orWhere($titleField, 'LIKE', "%{$request->get('query')}%") |
|
177 | + ->get(['id', "{$titleField} as name"]); |
|
178 | 178 | |
179 | 179 | return response()->json(['items' => $instance->toArray()]); |
180 | 180 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function firstWithModel($model) |
15 | 15 | { |
16 | - return app('scaffold.modules')->first(function ($module) use ($model) { |
|
16 | + return app('scaffold.modules')->first(function($module) use ($model) { |
|
17 | 17 | if (is_string($model)) { |
18 | 18 | return get_class($module->model()) === $model; |
19 | 19 | } |