@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace LaravelFlare\Flare\Http\Controllers; |
| 4 | 4 | |
| 5 | -use Illuminate\Http\Request; |
|
| 6 | 5 | use Illuminate\Contracts\Auth\Guard; |
| 7 | 6 | use LaravelFlare\Flare\Admin\AdminManager; |
| 8 | 7 | use Illuminate\Foundation\Bus\DispatchesJobs; |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | $view = 'admin.dashboard'; |
| 103 | 103 | |
| 104 | 104 | if (!view()->exists($view)) { |
| 105 | - $view = 'flare::'.$view; |
|
| 105 | + $view = 'flare::' . $view; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | return view($view, ['widgetAdminManager' => (new WidgetAdminManager())]); |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | /** |
| 75 | 75 | * Log the user. |
| 76 | 76 | * |
| 77 | - * @return \Illuminate\Http\RedirectReponse |
|
| 77 | + * @return \Illuminate\Http\RedirectResponse |
|
| 78 | 78 | */ |
| 79 | 79 | public function getLogout() |
| 80 | 80 | { |
@@ -170,8 +170,8 @@ |
||
| 170 | 170 | { |
| 171 | 171 | // Could swap this out for model -> getAttribute, then check if we have an attribute or a relation... getRelationValue() is helpful |
| 172 | 172 | if (method_exists($this->model, $key) && is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\Relation')) { |
| 173 | - foreach ($this->{$action.'Relations'} as $relationship => $method) { |
|
| 174 | - if (is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\\'.$relationship)) { |
|
| 173 | + foreach ($this->{$action . 'Relations'} as $relationship => $method) { |
|
| 174 | + if (is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\\' . $relationship)) { |
|
| 175 | 175 | $this->model->$key()->$method($value); |
| 176 | 176 | |
| 177 | 177 | return; |
@@ -93,9 +93,9 @@ |
||
| 93 | 93 | protected function adminController($route = null) |
| 94 | 94 | { |
| 95 | 95 | if ($route) { |
| 96 | - return $this->namespace.'\\'.$this->compatibilityVersion.'\AdminController@'.$route; |
|
| 96 | + return $this->namespace . '\\' . $this->compatibilityVersion . '\AdminController@' . $route; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - return $this->namespace.'\\'.$this->compatibilityVersion.'\AdminController'; |
|
| 99 | + return $this->namespace . '\\' . $this->compatibilityVersion . '\AdminController'; |
|
| 100 | 100 | } |
| 101 | 101 | } |
@@ -27,22 +27,22 @@ |
||
| 27 | 27 | |
| 28 | 28 | if (!empty($_POST)) |
| 29 | 29 | {
|
| 30 | - foreach ( $_POST as $key => $value ) |
|
| 31 | - {
|
|
| 32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 33 | - continue; |
|
| 30 | + foreach ( $_POST as $key => $value ) |
|
| 31 | + {
|
|
| 32 | + if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 33 | + continue; |
|
| 34 | 34 | |
| 35 | - if ( get_magic_quotes_gpc() ) |
|
| 36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 37 | - else |
|
| 38 | - $value = htmlspecialchars( (string)$value ); |
|
| 35 | + if ( get_magic_quotes_gpc() ) |
|
| 36 | + $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 37 | + else |
|
| 38 | + $value = htmlspecialchars( (string)$value ); |
|
| 39 | 39 | ?> |
| 40 | 40 | <tr> |
| 41 | 41 | <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
| 42 | 42 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
| 43 | 43 | </tr> |
| 44 | 44 | <?php |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | } |
| 47 | 47 | ?> |
| 48 | 48 | </table> |
@@ -27,18 +27,18 @@ |
||
| 27 | 27 | |
| 28 | 28 | if (!empty($_POST)) |
| 29 | 29 | {
|
| 30 | - foreach ( $_POST as $key => $value ) |
|
| 30 | + foreach ($_POST as $key => $value) |
|
| 31 | 31 | {
|
| 32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 32 | + if ((!is_string($value) && !is_numeric($value)) || !is_string($key)) |
|
| 33 | 33 | continue; |
| 34 | 34 | |
| 35 | - if ( get_magic_quotes_gpc() ) |
|
| 36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 35 | + if (get_magic_quotes_gpc()) |
|
| 36 | + $value = htmlspecialchars(stripslashes((string) $value)); |
|
| 37 | 37 | else |
| 38 | - $value = htmlspecialchars( (string)$value ); |
|
| 38 | + $value = htmlspecialchars((string) $value); |
|
| 39 | 39 | ?> |
| 40 | 40 | <tr> |
| 41 | - <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
|
| 41 | + <th style="vertical-align: top"><?php echo htmlspecialchars((string) $key); ?></th> |
|
| 42 | 42 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
| 43 | 43 | </tr> |
| 44 | 44 | <?php |
@@ -29,14 +29,16 @@ |
||
| 29 | 29 | {
|
| 30 | 30 | foreach ( $_POST as $key => $value ) |
| 31 | 31 | {
|
| 32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 33 | - continue; |
|
| 32 | + if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) { |
|
| 33 | + continue; |
|
| 34 | + } |
|
| 34 | 35 | |
| 35 | - if ( get_magic_quotes_gpc() ) |
|
| 36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 37 | - else |
|
| 38 | - $value = htmlspecialchars( (string)$value ); |
|
| 39 | -?> |
|
| 36 | + if ( get_magic_quotes_gpc() ) { |
|
| 37 | + $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 38 | + } else { |
|
| 39 | + $value = htmlspecialchars( (string)$value ); |
|
| 40 | + } |
|
| 41 | + ?> |
|
| 40 | 42 | <tr> |
| 41 | 43 | <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
| 42 | 44 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace LaravelFlare\Flare\Admin; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Arr; |
|
| 6 | 5 | use Illuminate\Support\Str; |
| 7 | 6 | use Illuminate\Routing\Router; |
| 8 | 7 | use LaravelFlare\Flare\Support\ControllerInspector; |
@@ -165,13 +165,13 @@ discard block |
||
| 165 | 165 | // route explicitly for the developers, so reverse routing is possible. |
| 166 | 166 | foreach ($routable as $method => $routes) { |
| 167 | 167 | foreach ($routes as $route) { |
| 168 | - $action = ['uses' => $controller.'@'.$method]; |
|
| 168 | + $action = ['uses' => $controller . '@' . $method]; |
|
| 169 | 169 | |
| 170 | 170 | \Route::{$route['verb']}($route['uri'], $action); |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - \Route::any($uri.'/{_missing}', $controller.'@missingMethod'); |
|
| 174 | + \Route::any($uri . '/{_missing}', $controller . '@missingMethod'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | return $this->view; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - return 'flare::'.$this->view; |
|
| 244 | + return 'flare::' . $this->view; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | public function getTitle() |
| 323 | 323 | { |
| 324 | 324 | if (!isset($this->title) || !$this->title) { |
| 325 | - return Str::title(str_replace('_', ' ', snake_case(preg_replace('/'.static::CLASS_SUFFIX.'$/', '', static::shortName())))); |
|
| 325 | + return Str::title(str_replace('_', ' ', snake_case(preg_replace('/' . static::CLASS_SUFFIX . '$/', '', static::shortName())))); |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | return $this->title; |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | public function relativeUrl($path = '') |
| 399 | 399 | { |
| 400 | - return \Flare::relativeAdminUrl($this->urlPrefix().($path ? '/'.$path : '')); |
|
| 400 | + return \Flare::relativeAdminUrl($this->urlPrefix() . ($path ? '/' . $path : '')); |
|
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | /** |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | */ |
| 422 | 422 | public function relativeCurrentUrl($path) |
| 423 | 423 | { |
| 424 | - return \Route::current() ? \Route::current()->getPrefix().'/'.$path : null; |
|
| 424 | + return \Route::current() ? \Route::current()->getPrefix() . '/' . $path : null; |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | /* |
@@ -29,7 +29,6 @@ |
||
| 29 | 29 | /** |
| 30 | 30 | * Register any application authentication / authorization services. |
| 31 | 31 | * |
| 32 | - * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
|
| 33 | 32 | */ |
| 34 | 33 | public function boot() |
| 35 | 34 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | // If the routable method is an index method, we will create a special index |
| 49 | 49 | // route which is simply the prefix and the verb and does not contain any |
| 50 | 50 | // the wildcard place-holders that each "typical" routes would contain. |
| 51 | - if ($data['plain'] == $prefix.'/index') { |
|
| 51 | + if ($data['plain'] == $prefix . '/index') { |
|
| 52 | 52 | $routable[$method->name][] = $this->getIndexData($data, $prefix); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function getPlainUri($name, $prefix) |
| 122 | 122 | { |
| 123 | - return $prefix.'/'.implode('-', array_slice(explode('_', Str::snake($name)), 1)); |
|
| 123 | + return $prefix . '/' . implode('-', array_slice(explode('_', Str::snake($name)), 1)); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -131,6 +131,6 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function addUriWildcards($uri) |
| 133 | 133 | { |
| 134 | - return $uri.'/{one?}/{two?}/{three?}/{four?}/{five?}'; |
|
| 134 | + return $uri . '/{one?}/{two?}/{three?}/{four?}/{five?}'; |
|
| 135 | 135 | } |
| 136 | 136 | } |