| @@ -209,7 +209,6 @@ discard block | ||
| 209 | 209 | /** | 
| 210 | 210 | * Process Restore ModelItem Request. | 
| 211 | 211 | * | 
| 212 | - * @param int $page_id | |
| 213 | 212 | * | 
| 214 | 213 | * @return \Illuminate\Http\RedirectResponse | 
| 215 | 214 | */ | 
| @@ -225,7 +224,7 @@ discard block | ||
| 225 | 224 | * | 
| 226 | 225 | * @param int $modelitem_id | 
| 227 | 226 | * | 
| 228 | - * @return \Illuminate\Http\Response | |
| 227 | + * @return \Illuminate\Http\RedirectResponse | |
| 229 | 228 | */ | 
| 230 | 229 | public function getClone($modelitem_id) | 
| 231 | 230 |      { | 
| @@ -117,7 +117,7 @@ discard block | ||
| 117 | 117 |      { | 
| 118 | 118 | $this->modelAdmin->create(); | 
| 119 | 119 | |
| 120 | -        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully created.', 'dismissable' => false]]); | |
| 120 | +        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully created.', 'dismissable' => false]]); | |
| 121 | 121 | } | 
| 122 | 122 | |
| 123 | 123 | /** | 
| @@ -159,7 +159,7 @@ discard block | ||
| 159 | 159 |      { | 
| 160 | 160 | $this->modelAdmin->edit($modelitem_id); | 
| 161 | 161 | |
| 162 | -        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully updated.', 'dismissable' => false]]); | |
| 162 | +        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully updated.', 'dismissable' => false]]); | |
| 163 | 163 | } | 
| 164 | 164 | |
| 165 | 165 | /** | 
| @@ -191,7 +191,7 @@ discard block | ||
| 191 | 191 |      { | 
| 192 | 192 | $this->modelAdmin->delete($modelitem_id); | 
| 193 | 193 | |
| 194 | -        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully removed.', 'dismissable' => false]]); | |
| 194 | +        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully removed.', 'dismissable' => false]]); | |
| 195 | 195 | } | 
| 196 | 196 | |
| 197 | 197 | /** | 
| @@ -217,7 +217,7 @@ discard block | ||
| 217 | 217 |      { | 
| 218 | 218 | $this->modelAdmin->findOnlyTrashed($modelitem_id)->restore(); | 
| 219 | 219 | |
| 220 | -        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully restored.', 'dismissable' => false]]); | |
| 220 | +        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully restored.', 'dismissable' => false]]); | |
| 221 | 221 | } | 
| 222 | 222 | |
| 223 | 223 | /** | 
| @@ -231,6 +231,6 @@ discard block | ||
| 231 | 231 |      { | 
| 232 | 232 | $this->modelAdmin->find($modelitem_id)->replicate($this->modelAdmin->excludeOnClone())->save(); | 
| 233 | 233 | |
| 234 | -        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully cloned.', 'dismissable' => false]]); | |
| 234 | +        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully cloned.', 'dismissable' => false]]); | |
| 235 | 235 | } | 
| 236 | 236 | } | 
| @@ -331,7 +331,7 @@ | ||
| 331 | 331 | * | 
| 332 | 332 | * @param string $goBack | 
| 333 | 333 | * | 
| 334 | - * @return mixed | |
| 334 | + * @return null|false | |
| 335 | 335 | */ | 
| 336 | 336 | protected function goBack($goBack) | 
| 337 | 337 |      { | 
| @@ -97,7 +97,7 @@ discard block | ||
| 97 | 97 | return; | 
| 98 | 98 | } | 
| 99 | 99 | |
| 100 | -        $this->info('Adding Model: '.$className); | |
| 100 | +        $this->info('Adding Model: ' . $className); | |
| 101 | 101 | |
| 102 | 102 |          $this->addModelData('classname', $className); | 
| 103 | 103 | |
| @@ -136,7 +136,7 @@ discard block | ||
| 136 | 136 | */ | 
| 137 | 137 | protected function defineNamespace() | 
| 138 | 138 |      { | 
| 139 | -        $this->info('Models will be added to the '.$this->namespace.' Namespace.'); | |
| 139 | +        $this->info('Models will be added to the ' . $this->namespace . ' Namespace.'); | |
| 140 | 140 | |
| 141 | 141 |          $this->namespace = $this->ask('If this is incorrect please provide your namespace:', $this->namespace); | 
| 142 | 142 | } | 
| @@ -168,7 +168,7 @@ discard block | ||
| 168 | 168 |              $tablename = $this->ask('Please provide a the table name for your Model?'); | 
| 169 | 169 | } | 
| 170 | 170 | |
| 171 | -        if ($tablename && $this->confirm('The table name of `'.$tablename.'`, is this correct?')) { | |
| 171 | +        if ($tablename && $this->confirm('The table name of `' . $tablename . '`, is this correct?')) { | |
| 172 | 172 |              $this->addModelData('table', $tablename); | 
| 173 | 173 | |
| 174 | 174 | return; | 
| @@ -201,7 +201,7 @@ discard block | ||
| 201 | 201 | return static::$view; | 
| 202 | 202 | } | 
| 203 | 203 | |
| 204 | - return 'flare::'.static::$view; | |
| 204 | + return 'flare::' . static::$view; | |
| 205 | 205 | } | 
| 206 | 206 | |
| 207 | 207 | /** | 
| @@ -307,7 +307,7 @@ discard block | ||
| 307 | 307 | */ | 
| 308 | 308 | public static function relativeUrl($path = '') | 
| 309 | 309 |      { | 
| 310 | - return \Flare::relativeAdminUrl(static::urlPrefix().($path ? '/'.$path : '')); | |
| 310 | + return \Flare::relativeAdminUrl(static::urlPrefix() . ($path ? '/' . $path : '')); | |
| 311 | 311 | } | 
| 312 | 312 | |
| 313 | 313 | /** | 
| @@ -331,7 +331,7 @@ discard block | ||
| 331 | 331 | */ | 
| 332 | 332 | public static function relativeCurrentUrl($path) | 
| 333 | 333 |      { | 
| 334 | - return \Route::current() ? \Route::current()->getPrefix().'/'.$path : null; | |
| 334 | + return \Route::current() ? \Route::current()->getPrefix() . '/' . $path : null; | |
| 335 | 335 | } | 
| 336 | 336 | |
| 337 | 337 | /** | 
| @@ -72,7 +72,7 @@ discard block | ||
| 72 | 72 | */ | 
| 73 | 73 | public function renderAdd() | 
| 74 | 74 |      { | 
| 75 | - return view($this->viewpath.'.add', []); | |
| 75 | + return view($this->viewpath . '.add', []); | |
| 76 | 76 | } | 
| 77 | 77 | |
| 78 | 78 | /** | 
| @@ -82,7 +82,7 @@ discard block | ||
| 82 | 82 | */ | 
| 83 | 83 | public function renderEdit() | 
| 84 | 84 |      { | 
| 85 | - return view($this->viewpath.'.edit', []); | |
| 85 | + return view($this->viewpath . '.edit', []); | |
| 86 | 86 | } | 
| 87 | 87 | |
| 88 | 88 | /** | 
| @@ -92,7 +92,7 @@ discard block | ||
| 92 | 92 | */ | 
| 93 | 93 | public function renderView() | 
| 94 | 94 |      { | 
| 95 | - return view($this->viewpath.'.view', []); | |
| 95 | + return view($this->viewpath . '.view', []); | |
| 96 | 96 | } | 
| 97 | 97 | |
| 98 | 98 | /** | 
| @@ -122,10 +122,10 @@ discard block | ||
| 122 | 122 | */ | 
| 123 | 123 | public function getFieldOptions() | 
| 124 | 124 |      { | 
| 125 | -        if (method_exists($this->getModelManager(), $method = camel_case('get_'.$this->getAttribute().'_options'))) { | |
| 125 | +        if (method_exists($this->getModelManager(), $method = camel_case('get_' . $this->getAttribute() . '_options'))) { | |
| 126 | 126 | // First check for a method of options based on getAttributeNameOptions() | 
| 127 | 127 | $this->field['options'] = $this->getModelManager()->$method(); | 
| 128 | -        } elseif (isset($this->field['options']) && is_string($this->field['options']) && method_exists($this->getModelManager(), $method = camel_case('get_'.$this->field['options'].'_options'))) { | |
| 128 | +        } elseif (isset($this->field['options']) && is_string($this->field['options']) && method_exists($this->getModelManager(), $method = camel_case('get_' . $this->field['options'] . '_options'))) { | |
| 129 | 129 | // Check if Options is a string and if so, check for a method | 
| 130 | 130 | // of options based on getDefinedOptions() | 
| 131 | 131 | $this->field['options'] = $this->getModelManager()->$method(); | 
| @@ -31,16 +31,16 @@ | ||
| 31 | 31 | return static::$view; | 
| 32 | 32 | } | 
| 33 | 33 | |
| 34 | -        if (view()->exists('admin.menus.'.static::location().'.widget')) { | |
| 35 | - return 'admin.'.static::safeTitle().'.widget'; | |
| 34 | +        if (view()->exists('admin.menus.' . static::location() . '.widget')) { | |
| 35 | + return 'admin.' . static::safeTitle() . '.widget'; | |
| 36 | 36 | } | 
| 37 | 37 | |
| 38 | -        if (view()->exists('admin.menus.'.static::safeTitle())) { | |
| 39 | - return 'admin.menus.'.static::safeTitle(); | |
| 38 | +        if (view()->exists('admin.menus.' . static::safeTitle())) { | |
| 39 | + return 'admin.menus.' . static::safeTitle(); | |
| 40 | 40 | } | 
| 41 | 41 | |
| 42 | -        if (view()->exists('flare::'.self::$view)) { | |
| 43 | - return 'flare::'.self::$view; | |
| 42 | +        if (view()->exists('flare::' . self::$view)) { | |
| 43 | + return 'flare::' . self::$view; | |
| 44 | 44 | } | 
| 45 | 45 | } | 
| 46 | 46 | |
| @@ -40,16 +40,16 @@ | ||
| 40 | 40 | return static::$view; | 
| 41 | 41 | } | 
| 42 | 42 | |
| 43 | -        if (view()->exists('admin.'.static::urlPrefix().'.index')) { | |
| 44 | - return 'admin.'.static::urlPrefix().'.index'; | |
| 43 | +        if (view()->exists('admin.' . static::urlPrefix() . '.index')) { | |
| 44 | + return 'admin.' . static::urlPrefix() . '.index'; | |
| 45 | 45 | } | 
| 46 | 46 | |
| 47 | -        if (view()->exists('admin.'.static::urlPrefix())) { | |
| 48 | - return 'admin.'.static::urlPrefix(); | |
| 47 | +        if (view()->exists('admin.' . static::urlPrefix())) { | |
| 48 | + return 'admin.' . static::urlPrefix(); | |
| 49 | 49 | } | 
| 50 | 50 | |
| 51 | -        if (view()->exists('flare::'.self::$view)) { | |
| 52 | - return 'flare::'.self::$view; | |
| 51 | +        if (view()->exists('flare::' . self::$view)) { | |
| 52 | + return 'flare::' . self::$view; | |
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | 55 | return parent::getView(); | 
| @@ -50,8 +50,6 @@ | ||
| 50 | 50 | $this->viewData['bgColour'] = $this->bgColours[self::$counter]; | 
| 51 | 51 | $this->viewData['pluralTitle'] = $modelAdmin::pluralTitle(); | 
| 52 | 52 | $this->viewData['modelTotal'] = $modelAdmin->model()->count(); | 
| 53 | - $this->viewData['icon'] = $modelAdmin::getIcon(); | |
| 54 | - | |
| 55 | - ++self::$counter; | |
| 53 | + $this->viewData['icon'] = $modelAdmin::getIcon();++self::$counter; | |
| 56 | 54 | } | 
| 57 | 55 | } | 
| @@ -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 | |
| @@ -42,7 +42,7 @@ discard block | ||
| 42 | 42 | */ | 
| 43 | 43 | protected function getStub() | 
| 44 | 44 |      { | 
| 45 | - return __DIR__.'/../../stubs/model-admin-controller.stub'; | |
| 45 | + return __DIR__ . '/../../stubs/model-admin-controller.stub'; | |
| 46 | 46 | } | 
| 47 | 47 | |
| 48 | 48 | /** | 
| @@ -54,6 +54,6 @@ discard block | ||
| 54 | 54 | */ | 
| 55 | 55 | protected function getDefaultNamespace($rootNamespace) | 
| 56 | 56 |      { | 
| 57 | - return $rootNamespace.'\Admin\\Http\\Controllers'; | |
| 57 | + return $rootNamespace . '\Admin\\Http\\Controllers'; | |
| 58 | 58 | } | 
| 59 | 59 | } |