@@ -127,7 +127,7 @@ |
||
| 127 | 127 | /** |
| 128 | 128 | * Returns the path to a provided file within the Flare package. |
| 129 | 129 | * |
| 130 | - * @param bool $fiepath |
|
| 130 | + * @param bool $filepath |
|
| 131 | 131 | * |
| 132 | 132 | * @return string |
| 133 | 133 | */ |
@@ -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 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | return $this->view; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - return 'flare::'.$this->view; |
|
| 215 | + return 'flare::' . $this->view; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | public function relativeUrl($path = '') |
| 370 | 370 | { |
| 371 | - return \Flare::relativeAdminUrl($this->urlPrefix().($path ? '/'.$path : '')); |
|
| 371 | + return \Flare::relativeAdminUrl($this->urlPrefix() . ($path ? '/' . $path : '')); |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | /** |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | public function relativeCurrentUrl($path) |
| 394 | 394 | { |
| 395 | - return \Route::current() ? \Route::current()->getPrefix().'/'.$path : null; |
|
| 395 | + return \Route::current() ? \Route::current()->getPrefix() . '/' . $path : null; |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | /** |
@@ -24,10 +24,10 @@ |
||
| 24 | 24 | if ($this->attributeTypeExists($field['type'])) { |
| 25 | 25 | $fieldType = $this->resolveAttributeClass($field['type']); |
| 26 | 26 | |
| 27 | - return call_user_func_array([new $fieldType($attribute, $field, $model, $modelManager), camel_case('render_'.$action)], []); |
|
| 27 | + return call_user_func_array([new $fieldType($attribute, $field, $model, $modelManager), camel_case('render_' . $action)], []); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - return call_user_func_array([new BaseAttribute($attribute, $field, $model, $modelManager), camel_case('render_'.$action)], []); |
|
| 30 | + return call_user_func_array([new BaseAttribute($attribute, $field, $model, $modelManager), camel_case('render_' . $action)], []); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function renderAdd() |
| 72 | 72 | { |
| 73 | - return view($this->viewpath.'.add', $this->viewData()); |
|
| 73 | + return view($this->viewpath . '.add', $this->viewData()); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function renderEdit() |
| 82 | 82 | { |
| 83 | - return view($this->viewpath.'.edit', $this->viewData()); |
|
| 83 | + return view($this->viewpath . '.edit', $this->viewData()); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function renderClone() |
| 92 | 92 | { |
| 93 | - if (view()->exists($this->viewpath.'.clone')) { |
|
| 94 | - view($this->viewpath.'.clone', $this->viewData()); |
|
| 93 | + if (view()->exists($this->viewpath . '.clone')) { |
|
| 94 | + view($this->viewpath . '.clone', $this->viewData()); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - return view($this->viewpath.'.edit', $this->viewData()); |
|
| 97 | + return view($this->viewpath . '.edit', $this->viewData()); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function renderView() |
| 106 | 106 | { |
| 107 | - return view($this->viewpath.'.view', $this->viewData()); |
|
| 107 | + return view($this->viewpath . '.view', $this->viewData()); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -134,10 +134,10 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function getFieldOptions() |
| 136 | 136 | { |
| 137 | - if (method_exists($this->getModelManager(), $method = camel_case('get_'.$this->getAttribute().'_options'))) { |
|
| 137 | + if (method_exists($this->getModelManager(), $method = camel_case('get_' . $this->getAttribute() . '_options'))) { |
|
| 138 | 138 | // First check for a method of options based on getAttributeNameOptions() |
| 139 | 139 | $this->field['options'] = $this->getModelManager()->$method(); |
| 140 | - } elseif (isset($this->field['options']) && is_string($this->field['options']) && method_exists($this->getModelManager(), $method = camel_case('get_'.$this->field['options'].'_options'))) { |
|
| 140 | + } elseif (isset($this->field['options']) && is_string($this->field['options']) && method_exists($this->getModelManager(), $method = camel_case('get_' . $this->field['options'] . '_options'))) { |
|
| 141 | 141 | // Check if Options is a string and if so, check for a method |
| 142 | 142 | // of options based on getDefinedOptions() |
| 143 | 143 | $this->field['options'] = $this->getModelManager()->$method(); |
@@ -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 | /** |
@@ -29,11 +29,11 @@ |
||
| 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 |