@@ -49,20 +49,20 @@ |
||
| 49 | 49 | return static::$view; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if (view()->exists('admin.widgets.'.static::safeTitle().'.widget')) { |
|
| 53 | - return 'admin.widgets.'.static::safeTitle().'.widget'; |
|
| 52 | + if (view()->exists('admin.widgets.' . static::safeTitle() . '.widget')) { |
|
| 53 | + return 'admin.widgets.' . static::safeTitle() . '.widget'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - if (view()->exists('admin.widgets.'.static::safeTitle())) { |
|
| 57 | - return 'admin.widgets.'.static::safeTitle(); |
|
| 56 | + if (view()->exists('admin.widgets.' . static::safeTitle())) { |
|
| 57 | + return 'admin.widgets.' . static::safeTitle(); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if (view()->exists('admin.'.static::safeTitle())) { |
|
| 61 | - return 'admin.'.static::safeTitle(); |
|
| 60 | + if (view()->exists('admin.' . static::safeTitle())) { |
|
| 61 | + return 'admin.' . static::safeTitle(); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - if (view()->exists('flare::'.self::$view)) { |
|
| 65 | - return 'flare::'.self::$view; |
|
| 64 | + if (view()->exists('flare::' . self::$view)) { |
|
| 65 | + return 'flare::' . self::$view; |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
| 30 | 30 | // indexes |
| 31 | 31 | $columns = array( |
| 32 | - array( 'db' => 'id', 'dt' => 0 ), |
|
| 33 | - array( 'db' => 'firstname', 'dt' => 1 ), |
|
| 34 | - array( 'db' => 'surname', 'dt' => 2 ), |
|
| 35 | - array( 'db' => 'zip', 'dt' => 3 ), |
|
| 36 | - array( 'db' => 'country', 'dt' => 4 ) |
|
| 32 | + array( 'db' => 'id', 'dt' => 0 ), |
|
| 33 | + array( 'db' => 'firstname', 'dt' => 1 ), |
|
| 34 | + array( 'db' => 'surname', 'dt' => 2 ), |
|
| 35 | + array( 'db' => 'zip', 'dt' => 3 ), |
|
| 36 | + array( 'db' => 'country', 'dt' => 4 ) |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | // SQL server connection information |
| 40 | 40 | $sql_details = array( |
| 41 | - 'user' => '', |
|
| 42 | - 'pass' => '', |
|
| 43 | - 'db' => '', |
|
| 44 | - 'host' => '' |
|
| 41 | + 'user' => '', |
|
| 42 | + 'pass' => '', |
|
| 43 | + 'db' => '', |
|
| 44 | + 'host' => '' |
|
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | |
@@ -53,6 +53,6 @@ discard block |
||
| 53 | 53 | require( '../../../../examples/server_side/scripts/ssp.class.php' ); |
| 54 | 54 | |
| 55 | 55 | echo json_encode( |
| 56 | - SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
| 56 | + SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
| 57 | 57 | ); |
| 58 | 58 | |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
| 30 | 30 | // indexes |
| 31 | 31 | $columns = array( |
| 32 | - array( 'db' => 'id', 'dt' => 0 ), |
|
| 33 | - array( 'db' => 'firstname', 'dt' => 1 ), |
|
| 34 | - array( 'db' => 'surname', 'dt' => 2 ), |
|
| 35 | - array( 'db' => 'zip', 'dt' => 3 ), |
|
| 36 | - array( 'db' => 'country', 'dt' => 4 ) |
|
| 32 | + array('db' => 'id', 'dt' => 0), |
|
| 33 | + array('db' => 'firstname', 'dt' => 1), |
|
| 34 | + array('db' => 'surname', 'dt' => 2), |
|
| 35 | + array('db' => 'zip', 'dt' => 3), |
|
| 36 | + array('db' => 'country', 'dt' => 4) |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | // SQL server connection information |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | * server-side, there is no need to edit below this line. |
| 51 | 51 | */ |
| 52 | 52 | |
| 53 | -require( '../../../../examples/server_side/scripts/ssp.class.php' ); |
|
| 53 | +require('../../../../examples/server_side/scripts/ssp.class.php'); |
|
| 54 | 54 | |
| 55 | 55 | echo json_encode( |
| 56 | - SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
| 56 | + SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns) |
|
| 57 | 57 | ); |
| 58 | 58 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | if (($methodBreaker = strpos($field, '.')) !== false) { |
| 150 | 150 | $method = substr($field, 0, $methodBreaker); |
| 151 | 151 | if (method_exists($this->model, $method)) { |
| 152 | - if (method_exists($this->model->$method(), $submethod = str_replace($method.'.', '', $field))) { |
|
| 152 | + if (method_exists($this->model->$method(), $submethod = str_replace($method . '.', '', $field))) { |
|
| 153 | 153 | $this->model->$method()->$submethod(); |
| 154 | 154 | |
| 155 | 155 | $columns[$field] = $fieldTitle; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | if ($this->hasGetAccessor($key)) { |
| 192 | - $method = 'get'.Str::studly($key).'Attribute'; |
|
| 192 | + $method = 'get' . Str::studly($key) . 'Attribute'; |
|
| 193 | 193 | |
| 194 | 194 | return $this->{$method}($model); |
| 195 | 195 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | public function hasGetAccessor($key) |
| 212 | 212 | { |
| 213 | - return method_exists($this, 'get'.Str::studly($key).'Attribute'); |
|
| 213 | + return method_exists($this, 'get' . Str::studly($key) . 'Attribute'); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | if (($methodBreaker = strpos($key, '.')) !== false) { |
| 256 | 256 | $method = substr($key, 0, $methodBreaker); |
| 257 | 257 | if (method_exists($model, $method)) { |
| 258 | - if (method_exists($model->$method, $submethod = str_replace($method.'.', '', $key))) { |
|
| 258 | + if (method_exists($model->$method, $submethod = str_replace($method . '.', '', $key))) { |
|
| 259 | 259 | return $model->$method->$submethod(); |
| 260 | 260 | } |
| 261 | 261 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | public function setAttribute($key, $value) |
| 280 | 280 | { |
| 281 | 281 | if ($this->hasSetMutator($key)) { |
| 282 | - $method = 'set'.Str::studly($key).'Attribute'; |
|
| 282 | + $method = 'set' . Str::studly($key) . 'Attribute'; |
|
| 283 | 283 | |
| 284 | 284 | return $this->{$method}($value); |
| 285 | 285 | } |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | */ |
| 297 | 297 | public function hasSetMutator($key) |
| 298 | 298 | { |
| 299 | - return method_exists($this, 'set'.Str::studly($key).'Attribute'); |
|
| 299 | + return method_exists($this, 'set' . Str::studly($key) . 'Attribute'); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function hasGetMutator($key) |
| 310 | 310 | { |
| 311 | - return method_exists($this, 'get'.Str::studly($key).'Attribute'); |
|
| 311 | + return method_exists($this, 'get' . Str::studly($key) . 'Attribute'); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $this->modelAdmin->create(); |
| 115 | 115 | |
| 116 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully created.', 'dismissable' => false]]); |
|
| 116 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->getTitle() . ' was successfully created.', 'dismissable' => false]]); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | { |
| 156 | 156 | $this->modelAdmin->edit($modelitem_id); |
| 157 | 157 | |
| 158 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully updated.', 'dismissable' => false]]); |
|
| 158 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->getTitle() . ' was successfully updated.', 'dismissable' => false]]); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | { |
| 188 | 188 | $this->modelAdmin->delete($modelitem_id); |
| 189 | 189 | |
| 190 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully removed.', 'dismissable' => false]]); |
|
| 190 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->getTitle() . ' was successfully removed.', 'dismissable' => false]]); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | { |
| 214 | 214 | $this->modelAdmin->findOnlyTrashed($modelitem_id)->restore(); |
| 215 | 215 | |
| 216 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully restored.', 'dismissable' => false]]); |
|
| 216 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->getTitle() . ' was successfully restored.', 'dismissable' => false]]); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -227,6 +227,6 @@ discard block |
||
| 227 | 227 | { |
| 228 | 228 | $this->modelAdmin->find($modelitem_id)->replicate($this->modelAdmin->excludeOnClone())->save(); |
| 229 | 229 | |
| 230 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully cloned.', 'dismissable' => false]]); |
|
| 230 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->getTitle() . ' was successfully cloned.', 'dismissable' => false]]); |
|
| 231 | 231 | } |
| 232 | 232 | } |
@@ -40,16 +40,16 @@ |
||
| 40 | 40 | return $this->view; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (view()->exists('admin.'.$this->urlPrefix().'.index')) { |
|
| 44 | - return 'admin.'.$this->urlPrefix().'.index'; |
|
| 43 | + if (view()->exists('admin.' . $this->urlPrefix() . '.index')) { |
|
| 44 | + return 'admin.' . $this->urlPrefix() . '.index'; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if (view()->exists('admin.'.$this->urlPrefix())) { |
|
| 48 | - return 'admin.'.$this->urlPrefix(); |
|
| 47 | + if (view()->exists('admin.' . $this->urlPrefix())) { |
|
| 48 | + return 'admin.' . $this->urlPrefix(); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if (view()->exists('flare::'.$this->view)) { |
|
| 52 | - return 'flare::'.$this->view; |
|
| 51 | + if (view()->exists('flare::' . $this->view)) { |
|
| 52 | + return 'flare::' . $this->view; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | return parent::getView(); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | return $this->config[$key]; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - return config('flare.'.$key); |
|
| 133 | + return config('flare.' . $key); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | */ |
| 234 | 234 | public function relativeAdminUrl($path = '') |
| 235 | 235 | { |
| 236 | - return rtrim($this->getRelativeAdminUrl().'/'.$path, '/'); |
|
| 236 | + return rtrim($this->getRelativeAdminUrl() . '/' . $path, '/'); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | public function docsUrl($path = '') |
| 273 | 273 | { |
| 274 | - return url('#'.$path); |
|
| 274 | + return url('#' . $path); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
@@ -133,6 +133,6 @@ |
||
| 133 | 133 | */ |
| 134 | 134 | private function basePath($filepath = false) |
| 135 | 135 | { |
| 136 | - return __DIR__.'/../'.$filepath; |
|
| 136 | + return __DIR__ . '/../' . $filepath; |
|
| 137 | 137 | } |
| 138 | 138 | } |
@@ -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; |
@@ -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())]); |