@@ -26,6 +26,9 @@ |
||
| 26 | 26 | return $this->model->withDepth()->find($id, $columns); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $name |
|
| 31 | + */ |
|
| 29 | 32 | public function tree($name) |
| 30 | 33 | { |
| 31 | 34 | $root = $this->findBy('name', $name); |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $body = []; |
| 71 | 71 | |
| 72 | 72 | foreach ($data as $row): |
| 73 | - $actions =[ |
|
| 73 | + $actions = [ |
|
| 74 | 74 | 'edit' => ['url' => route('bp.menus.edit', [$row->id])] |
| 75 | 75 | ]; |
| 76 | 76 | |
@@ -97,6 +97,9 @@ |
||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | + /** |
|
| 101 | + * @param string $name |
|
| 102 | + */ |
|
| 100 | 103 | public function getUniqueUsername($name) |
| 101 | 104 | { |
| 102 | 105 | $nrRand = rand(0,100); |
@@ -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], |
@@ -37,12 +37,12 @@ |
||
| 37 | 37 | |
| 38 | 38 | public function create(Permissions $permissions) |
| 39 | 39 | { |
| 40 | - return view('back-project::roles.create')->with('permissions', $permissions->all()); |
|
| 40 | + return view('back-project::roles.create')->with('permissions', $permissions->all()); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function store(RoleAdd $request, Roles $roles) |
| 44 | 44 | { |
| 45 | - $role= $roles->create($request->all()); |
|
| 45 | + $role = $roles->create($request->all()); |
|
| 46 | 46 | |
| 47 | 47 | Alert::add('success', trans('back-project::crud.model_created', ['model' => trans('back-project::roles.role')]))->flash(); |
| 48 | 48 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | |
| 43 | 43 | public function store(PermissionAdd $request, Permissions $permissions) |
| 44 | 44 | { |
| 45 | - $permission= $permissions->create($request->all()); |
|
| 45 | + $permission = $permissions->create($request->all()); |
|
| 46 | 46 | |
| 47 | 47 | Alert::add('success', trans('back-project::crud.model_created', ['model' => trans('back-project::permissions.permission')]))->flash(); |
| 48 | 48 | |
@@ -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 = [ |
@@ -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('bp.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('bp.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('bp.admin.dashboard'); |
| 13 | 13 | Route::get('account', 'UsersController@account')->name('bp.admin.account'); |
| 14 | 14 | Route::put('account', 'UsersController@accountStore')->name('bp.admin.add-account'); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | Route::get('attachments/{attachment}/main', 'AttachmentsController@setMain')->name('bp.attachments.main'); |
| 19 | 19 | Route::resource('attachments', 'AttachmentsController', ['except' => ['destroy', 'show'], 'as' => 'bp']); |
| 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('bp.users.delete'); // Implementing delete avoiding DELETE method |
| 23 | 23 | Route::resource('users', 'UsersController', ['except' => ['destroy', 'show'], 'as' => 'bp']); |
| 24 | 24 | |