@@ -30,12 +30,12 @@ |
||
| 30 | 30 | |
| 31 | 31 | public function hasConfirmationCode() |
| 32 | 32 | { |
| 33 | - return ! is_null($this->{$this->confirmation_token_field} ); |
|
| 33 | + return !is_null($this->{$this->confirmation_token_field} ); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function isPendingConfirmation() |
| 37 | 37 | { |
| 38 | - return ! $this->isConfirmed() && $this->hasConfirmationCode(); |
|
| 38 | + return !$this->isConfirmed() && $this->hasConfirmationCode(); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function getConfirmationField() |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function attachments() |
| 21 | 21 | { |
| 22 | - return $this->morphToMany( Attachment::class, 'attachable' )->orderBy('is_main', 'desc'); |
|
| 22 | + return $this->morphToMany(Attachment::class, 'attachable')->orderBy('is_main', 'desc'); |
|
| 23 | 23 | } |
| 24 | 24 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | return $this->model->create($data); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - public function update(array $data, $id, $attribute="id") |
|
| 51 | + public function update(array $data, $id, $attribute = "id") |
|
| 52 | 52 | { |
| 53 | 53 | $model_data = $this->model->where($attribute, '=', $id)->first(); |
| 54 | 54 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | return $this; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - public function skipCriteria($status = true){ |
|
| 126 | + public function skipCriteria($status = true) { |
|
| 127 | 127 | $this->skipCriteria = $status; |
| 128 | 128 | return $this; |
| 129 | 129 | } |
@@ -143,11 +143,11 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | public function applyCriteria() { |
| 146 | - if($this->skipCriteria === true) |
|
| 146 | + if ($this->skipCriteria === true) |
|
| 147 | 147 | return $this; |
| 148 | 148 | |
| 149 | - foreach($this->getCriteria() as $criteria) { |
|
| 150 | - if($criteria instanceof Criteria) |
|
| 149 | + foreach ($this->getCriteria() as $criteria) { |
|
| 150 | + if ($criteria instanceof Criteria) |
|
| 151 | 151 | $this->model = $criteria->apply($this->model, $this); |
| 152 | 152 | } |
| 153 | 153 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | public function getUniqueUsername($name) |
| 101 | 101 | { |
| 102 | - $nrRand = rand(0,100); |
|
| 102 | + $nrRand = rand(0, 100); |
|
| 103 | 103 | |
| 104 | 104 | return $name.$nrRand; |
| 105 | 105 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | foreach ($data as $row): |
| 134 | 134 | $body[] = [ |
| 135 | 135 | 'columns' => [ |
| 136 | - ['content' => '<img src="' . \Avatar::create(strtoupper($row->username))->toBase64() . '" alt="' . $row->username . ' width="40px" height="40px"> '], |
|
| 136 | + ['content' => '<img src="'.\Avatar::create(strtoupper($row->username))->toBase64().'" alt="'.$row->username.' width="40px" height="40px"> '], |
|
| 137 | 137 | //['content' => false, 'action' => false, 'icon' => ($row->isConfirmed() ? "check" : 'times')], |
| 138 | 138 | ['content' => $row->username], |
| 139 | 139 | ['content' => $row->email], |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $body = []; |
| 71 | 71 | |
| 72 | 72 | foreach ($data as $row): |
| 73 | - $actions =[ |
|
| 73 | + $actions = [ |
|
| 74 | 74 | 'edit' => ['url' => route('menus.edit', [$row->id])] |
| 75 | 75 | ]; |
| 76 | 76 | |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $body = []; |
| 55 | 55 | |
| 56 | 56 | foreach ($data as $row): |
| 57 | - $actions =[]; |
|
| 57 | + $actions = []; |
|
| 58 | 58 | |
| 59 | 59 | if ($row->name !== 'administrator' and $row->name !== 'user') { |
| 60 | 60 | $actions = [ |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | return 'Afrittella\BackProject\Models\Attachment'; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | - public function update(array $data, $id, $attribute="id") |
|
| 13 | + public function update(array $data, $id, $attribute = "id") |
|
| 14 | 14 | { |
| 15 | 15 | $model_data = $this->model->where($attribute, '=', $id)->first(); |
| 16 | 16 | |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $body = []; |
| 71 | 71 | |
| 72 | 72 | foreach ($data as $row): |
| 73 | - $actions =[]; |
|
| 73 | + $actions = []; |
|
| 74 | 74 | |
| 75 | 75 | if ($row->name !== 'administration' and $row->name !== 'backend') { |
| 76 | 76 | $actions = [ |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -Route::group(['namespace' => '\Afrittella\BackProject\Http\Controllers'], function () { |
|
| 3 | - Route::group(['middleware' => 'web'], function () { |
|
| 2 | +Route::group(['namespace' => '\Afrittella\BackProject\Http\Controllers'], function() { |
|
| 3 | + Route::group(['middleware' => 'web'], function() { |
|
| 4 | 4 | Route::get('confirm/{code}/{user}', 'Auth\RegisterController@confirm')->name('users.confirm'); |
| 5 | 5 | Route::auth(); |
| 6 | 6 | |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | Route::get('auth/{provider}/callback', 'Auth\SocialLoginController@handleProviderCallback')->name('social_callback'); |
| 9 | 9 | }); |
| 10 | 10 | |
| 11 | - Route::group(['middleware' => 'web', 'prefix' => config('back-project.route_prefix')], function () { |
|
| 11 | + Route::group(['middleware' => 'web', 'prefix' => config('back-project.route_prefix')], function() { |
|
| 12 | 12 | Route::get('dashboard', 'AdminController@dashboard')->name('admin.dashboard'); |
| 13 | 13 | Route::get('account', 'UsersController@account')->name('admin.account'); |
| 14 | 14 | Route::put('account', 'UsersController@accountStore')->name('admin.add-account'); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | Route::get('attachments/{attachment}/main', 'AttachmentsController@setMain')->name('attachments.main'); |
| 19 | 19 | Route::resource('attachments', 'AttachmentsController', ['except' => ['destroy', 'show']]); |
| 20 | 20 | // Users |
| 21 | - Route::group(['middleware' => 'role:administrator'], function () { |
|
| 21 | + Route::group(['middleware' => 'role:administrator'], function() { |
|
| 22 | 22 | Route::get('users/{user}/delete', 'UsersController@delete')->name('users.delete'); // Implementing delete avoiding DELETE method |
| 23 | 23 | Route::resource('users', 'UsersController', ['except' => ['destroy', 'show']]); |
| 24 | 24 | |