@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | public function register() |
20 | 20 | { |
21 | - $this->app->singleton('sleeping_owl', function () { |
|
21 | + $this->app->singleton('sleeping_owl', function() { |
|
22 | 22 | return new Admin(); |
23 | 23 | }); |
24 | 24 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->registerWysiwyg(); |
27 | 27 | $this->registerAliases(); |
28 | 28 | |
29 | - ModelConfiguration::setEventDispatcher($this->app['events']); |
|
29 | + ModelConfiguration::setEventDispatcher($this->app[ 'events' ]); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | protected function getConfig($key) |
38 | 38 | { |
39 | - return $this->app['config']->get('sleeping_owl.'.$key); |
|
39 | + return $this->app[ 'config' ]->get('sleeping_owl.'.$key); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | protected function getBootstrapPath($path = null) |
48 | 48 | { |
49 | - if (! is_null($path)) { |
|
49 | + if (!is_null($path)) { |
|
50 | 50 | $path = DIRECTORY_SEPARATOR.$path; |
51 | 51 | } |
52 | 52 | |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | |
56 | 56 | public function boot() |
57 | 57 | { |
58 | - $this->app->singleton('sleeping_owl.template', function () { |
|
59 | - return $this->app['sleeping_owl']->template(); |
|
58 | + $this->app->singleton('sleeping_owl.template', function() { |
|
59 | + return $this->app[ 'sleeping_owl' ]->template(); |
|
60 | 60 | }); |
61 | 61 | |
62 | 62 | $this->registerCustomRoutes(); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $items = include $navigation; |
68 | 68 | |
69 | 69 | if (is_array($items)) { |
70 | - $this->app['sleeping_owl.navigation']->setFromArray($items); |
|
70 | + $this->app[ 'sleeping_owl.navigation' ]->setFromArray($items); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | } |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | $this->app->bind(\KodiComponents\Navigation\Contracts\PageInterface::class, \SleepingOwl\Admin\Navigation\Page::class); |
82 | 82 | $this->app->bind(\KodiComponents\Navigation\Contracts\BadgeInterface::class, \SleepingOwl\Admin\Navigation\Badge::class); |
83 | 83 | |
84 | - $this->app->singleton('sleeping_owl.navigation', function () { |
|
84 | + $this->app->singleton('sleeping_owl.navigation', function() { |
|
85 | 85 | return new \SleepingOwl\Admin\Navigation(); |
86 | 86 | }); |
87 | 87 | } |
88 | 88 | |
89 | 89 | protected function registerWysiwyg() |
90 | 90 | { |
91 | - $this->app->singleton('sleeping_owl.wysiwyg', function () { |
|
91 | + $this->app->singleton('sleeping_owl.wysiwyg', function() { |
|
92 | 92 | return new \SleepingOwl\Admin\Wysiwyg\Manager(); |
93 | 93 | }); |
94 | 94 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | $directory = $this->getBootstrapPath(); |
102 | 102 | |
103 | - if (! is_dir($directory)) { |
|
103 | + if (!is_dir($directory)) { |
|
104 | 104 | return; |
105 | 105 | } |
106 | 106 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | ->name('/^.+\.php$/') |
110 | 110 | ->notName('routes.php') |
111 | 111 | ->notName('navigation.php') |
112 | - ->in($directory)->sort(function ($a) { |
|
112 | + ->in($directory)->sort(function($a) { |
|
113 | 113 | return $a->getFilename() != 'bootstrap.php'; |
114 | 114 | }); |
115 | 115 | |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | |
121 | 121 | protected function registerAliases() |
122 | 122 | { |
123 | - AliasLoader::getInstance(config('sleeping_owl.aliases', [])); |
|
123 | + AliasLoader::getInstance(config('sleeping_owl.aliases', [ ])); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | protected function registerCustomRoutes() |
127 | 127 | { |
128 | 128 | if (file_exists($file = $this->getBootstrapPath('routes.php'))) { |
129 | - $this->registerRoutes(function () use ($file) { |
|
129 | + $this->registerRoutes(function() use ($file) { |
|
130 | 130 | require $file; |
131 | 131 | }); |
132 | 132 | } |
@@ -134,15 +134,15 @@ discard block |
||
134 | 134 | |
135 | 135 | protected function registerDefaultRoutes() |
136 | 136 | { |
137 | - $this->registerRoutes(function () { |
|
138 | - $this->app['router']->pattern('adminModelId', '[a-zA-Z0-9_-]+'); |
|
137 | + $this->registerRoutes(function() { |
|
138 | + $this->app[ 'router' ]->pattern('adminModelId', '[a-zA-Z0-9_-]+'); |
|
139 | 139 | |
140 | - $aliases = $this->app['sleeping_owl']->modelAliases(); |
|
140 | + $aliases = $this->app[ 'sleeping_owl' ]->modelAliases(); |
|
141 | 141 | |
142 | 142 | if (count($aliases) > 0) { |
143 | - $this->app['router']->pattern('adminModel', implode('|', $aliases)); |
|
143 | + $this->app[ 'router' ]->pattern('adminModel', implode('|', $aliases)); |
|
144 | 144 | |
145 | - $this->app['router']->bind('adminModel', function ($model, \Illuminate\Routing\Route $route) use ($aliases) { |
|
145 | + $this->app[ 'router' ]->bind('adminModel', function($model, \Illuminate\Routing\Route $route) use ($aliases) { |
|
146 | 146 | $class = array_search($model, $aliases); |
147 | 147 | |
148 | 148 | if ($class === false) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | /** @var ModelConfiguration $model */ |
153 | - $model = $this->app['sleeping_owl']->getModel($class); |
|
153 | + $model = $this->app[ 'sleeping_owl' ]->getModel($class); |
|
154 | 154 | |
155 | 155 | if ($model->hasCustomControllerClass()) { |
156 | 156 | list($controller, $action) = explode('@', $route->getActionName(), 2); |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | */ |
176 | 176 | protected function registerRoutes(\Closure $callback) |
177 | 177 | { |
178 | - $this->app['router']->group([ |
|
178 | + $this->app[ 'router' ]->group([ |
|
179 | 179 | 'prefix' => $this->getConfig('url_prefix'), |
180 | 180 | 'middleware' => $this->getConfig('middleware'), |
181 | - ], function () use ($callback) { |
|
181 | + ], function() use ($callback) { |
|
182 | 182 | call_user_func($callback); |
183 | 183 | }); |
184 | 184 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $title = $this->option('title'); |
39 | 39 | |
40 | - $this->call('vendor:publish', ['--provider' => SleepingOwlServiceProvider::class]); |
|
40 | + $this->call('vendor:publish', [ '--provider' => SleepingOwlServiceProvider::class ]); |
|
41 | 41 | |
42 | 42 | $this->publishConfig($title); |
43 | 43 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $directory = config('sleeping_owl.bootstrapDirectory'); |
57 | 57 | |
58 | - if (! is_dir($directory)) { |
|
58 | + if (!is_dir($directory)) { |
|
59 | 59 | $this->files->makeDirectory($directory, 0755, true, true); |
60 | 60 | $this->line('<info>Admin bootstrap directory was created:</info> '.str_replace(base_path(), '', $directory)); |
61 | 61 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | $file = config('sleeping_owl.bootstrapDirectory').'/navigation.php'; |
70 | 70 | |
71 | - if (! file_exists($file)) { |
|
71 | + if (!file_exists($file)) { |
|
72 | 72 | $contents = $this->files->get(__DIR__.'/stubs/navigation.stub'); |
73 | 73 | $this->files->put($file, $contents); |
74 | 74 | $this->line('<info>Menu file was created:</info> '.str_replace(base_path(), '', $file)); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | protected function createBootstrapFile() |
82 | 82 | { |
83 | 83 | $file = config('sleeping_owl.bootstrapDirectory').'/bootstrap.php'; |
84 | - if (! file_exists($file)) { |
|
84 | + if (!file_exists($file)) { |
|
85 | 85 | $contents = $this->files->get(__DIR__.'/stubs/bootstrap.stub'); |
86 | 86 | $this->files->put($file, $contents); |
87 | 87 | $this->line('<info>Bootstrap file was created:</info> '.str_replace(base_path(), '', $file)); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | protected function createRoutesFile() |
95 | 95 | { |
96 | 96 | $file = config('sleeping_owl.bootstrapDirectory').'/routes.php'; |
97 | - if (! file_exists($file)) { |
|
97 | + if (!file_exists($file)) { |
|
98 | 98 | $contents = $this->files->get(__DIR__.'/stubs/routes.stub'); |
99 | 99 | $this->files->put($file, $contents); |
100 | 100 | $this->line('<info>Bootstrap file was created:</info> '.str_replace(base_path(), '', $file)); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | protected function createPublicDefaultStructure() |
108 | 108 | { |
109 | 109 | $uploadsDirectory = public_path('images/uploads'); |
110 | - if (! is_dir($uploadsDirectory)) { |
|
110 | + if (!is_dir($uploadsDirectory)) { |
|
111 | 111 | $this->files->makeDirectory($uploadsDirectory, 0755, true, true); |
112 | 112 | } |
113 | 113 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | { |
122 | 122 | $file = config_path('sleeping_owl.php'); |
123 | 123 | |
124 | - if (! is_null($title)) { |
|
124 | + if (!is_null($title)) { |
|
125 | 125 | $contents = $this->files->get($file); |
126 | 126 | $contents = str_replace('Sleeping Owl administrator', $title, $contents); |
127 | 127 | $this->files->put($file, $contents); |