@@ -15,10 +15,10 @@ |
||
15 | 15 | |
16 | 16 | Route::group(['prefix' => 'DummyRoutePrefix'], function () { |
17 | 17 | |
18 | - Route::get('/', 'DummyController@index'); |
|
19 | - Route::get('{id}', 'DummyController@show'); |
|
20 | - Route::post('/', 'DummyController@store'); |
|
21 | - Route::patch('{id}', 'DummyController@update'); |
|
22 | - Route::delete('{id}', 'DummyController@destroy'); |
|
23 | - Route::patch('restore/{id}', 'DummyController@restore'); |
|
18 | + Route::get('/', 'DummyController@index'); |
|
19 | + Route::get('{id}', 'DummyController@show'); |
|
20 | + Route::post('/', 'DummyController@store'); |
|
21 | + Route::patch('{id}', 'DummyController@update'); |
|
22 | + Route::delete('{id}', 'DummyController@destroy'); |
|
23 | + Route::patch('restore/{id}', 'DummyController@restore'); |
|
24 | 24 | }); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | -Route::group(['prefix' => 'DummyRoutePrefix'], function () { |
|
16 | +Route::group(['prefix' => 'DummyRoutePrefix'], function() { |
|
17 | 17 | |
18 | 18 | Route::get('/', 'DummyController@index'); |
19 | 19 | Route::get('{id}', 'DummyController@show'); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | | |
12 | 12 | */ |
13 | 13 | |
14 | -Route::group(['prefix' => 'settings'], function () { |
|
14 | +Route::group(['prefix' => 'settings'], function() { |
|
15 | 15 | |
16 | 16 | Route::get('/', 'SettingController@index'); |
17 | 17 | Route::get('{id}', 'SettingController@show'); |
@@ -13,8 +13,8 @@ |
||
13 | 13 | |
14 | 14 | Route::group(['prefix' => 'settings'], function () { |
15 | 15 | |
16 | - Route::get('/', 'SettingController@index'); |
|
17 | - Route::get('{id}', 'SettingController@show'); |
|
18 | - Route::patch('{id}', 'SettingController@update'); |
|
19 | - Route::post('save/many', 'SettingController@saveMany'); |
|
16 | + Route::get('/', 'SettingController@index'); |
|
17 | + Route::get('{id}', 'SettingController@show'); |
|
18 | + Route::patch('{id}', 'SettingController@update'); |
|
19 | + Route::post('save/many', 'SettingController@saveMany'); |
|
20 | 20 | }); |
@@ -10,40 +10,40 @@ |
||
10 | 10 | |
11 | 11 | class RoleController extends BaseApiController |
12 | 12 | { |
13 | - /** |
|
14 | - * Path of the sotre form request. |
|
15 | - * |
|
16 | - * @var string |
|
17 | - */ |
|
18 | - protected $storeFormRequest = 'App\Modules\Roles\Http\Requests\StoreRole'; |
|
13 | + /** |
|
14 | + * Path of the sotre form request. |
|
15 | + * |
|
16 | + * @var string |
|
17 | + */ |
|
18 | + protected $storeFormRequest = 'App\Modules\Roles\Http\Requests\StoreRole'; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Path of the model resource |
|
22 | - * |
|
23 | - * @var string |
|
24 | - */ |
|
25 | - protected $modelResource = 'App\Modules\Roles\Http\Resources\Role'; |
|
20 | + /** |
|
21 | + * Path of the model resource |
|
22 | + * |
|
23 | + * @var string |
|
24 | + */ |
|
25 | + protected $modelResource = 'App\Modules\Roles\Http\Resources\Role'; |
|
26 | 26 | |
27 | - /** |
|
28 | - * Init new object. |
|
29 | - * |
|
30 | - * @param RoleService $service |
|
31 | - * @return void |
|
32 | - */ |
|
33 | - public function __construct(RoleService $service) |
|
34 | - { |
|
35 | - parent::__construct($service); |
|
36 | - } |
|
27 | + /** |
|
28 | + * Init new object. |
|
29 | + * |
|
30 | + * @param RoleService $service |
|
31 | + * @return void |
|
32 | + */ |
|
33 | + public function __construct(RoleService $service) |
|
34 | + { |
|
35 | + parent::__construct($service); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Handle an assign permissions to role request. |
|
40 | - * |
|
41 | - * @param AssignPermissions $request |
|
42 | - * @param integer $id |
|
43 | - * @return \Illuminate\Http\Response |
|
44 | - */ |
|
45 | - public function assignPermissions(AssignPermissions $request, $id) |
|
46 | - { |
|
47 | - return new $this->modelResource($this->service->assignPermissions($id, $request->get('permission_ids'))); |
|
48 | - } |
|
38 | + /** |
|
39 | + * Handle an assign permissions to role request. |
|
40 | + * |
|
41 | + * @param AssignPermissions $request |
|
42 | + * @param integer $id |
|
43 | + * @return \Illuminate\Http\Response |
|
44 | + */ |
|
45 | + public function assignPermissions(AssignPermissions $request, $id) |
|
46 | + { |
|
47 | + return new $this->modelResource($this->service->assignPermissions($id, $request->get('permission_ids'))); |
|
48 | + } |
|
49 | 49 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | -Route::group(['prefix' => 'roles'], function () { |
|
16 | +Route::group(['prefix' => 'roles'], function() { |
|
17 | 17 | |
18 | 18 | Route::get('/', 'RoleController@index'); |
19 | 19 | Route::get('{id}', 'RoleController@show'); |
@@ -15,11 +15,11 @@ |
||
15 | 15 | |
16 | 16 | Route::group(['prefix' => 'roles'], function () { |
17 | 17 | |
18 | - Route::get('/', 'RoleController@index'); |
|
19 | - Route::get('{id}', 'RoleController@show'); |
|
20 | - Route::post('/', 'RoleController@store'); |
|
21 | - Route::patch('{id}', 'RoleController@update'); |
|
22 | - Route::delete('{id}', 'RoleController@destroy'); |
|
23 | - Route::patch('restore/{id}', 'RoleController@restore'); |
|
24 | - Route::patch('assign/permissions/{id}', 'RoleController@assignPermissions'); |
|
18 | + Route::get('/', 'RoleController@index'); |
|
19 | + Route::get('{id}', 'RoleController@show'); |
|
20 | + Route::post('/', 'RoleController@store'); |
|
21 | + Route::patch('{id}', 'RoleController@update'); |
|
22 | + Route::delete('{id}', 'RoleController@destroy'); |
|
23 | + Route::patch('restore/{id}', 'RoleController@restore'); |
|
24 | + Route::patch('assign/permissions/{id}', 'RoleController@assignPermissions'); |
|
25 | 25 | }); |
@@ -11,39 +11,39 @@ |
||
11 | 11 | |
12 | 12 | class Kernel extends ConsoleKernel |
13 | 13 | { |
14 | - /** |
|
15 | - * The Artisan commands provided by your application. |
|
16 | - * |
|
17 | - * @var array |
|
18 | - */ |
|
19 | - protected $commands = [ |
|
20 | - GenerateDocCommand::class, |
|
21 | - PassportInstallCommand::class, |
|
22 | - MakeNotificationsCommand::class, |
|
23 | - MakeModuleCommand::class |
|
24 | - ]; |
|
14 | + /** |
|
15 | + * The Artisan commands provided by your application. |
|
16 | + * |
|
17 | + * @var array |
|
18 | + */ |
|
19 | + protected $commands = [ |
|
20 | + GenerateDocCommand::class, |
|
21 | + PassportInstallCommand::class, |
|
22 | + MakeNotificationsCommand::class, |
|
23 | + MakeModuleCommand::class |
|
24 | + ]; |
|
25 | 25 | |
26 | - /** |
|
27 | - * Define the application's command schedule. |
|
28 | - * |
|
29 | - * @param \Illuminate\Console\Scheduling\Schedule $schedule |
|
30 | - * @return void |
|
31 | - */ |
|
32 | - protected function schedule(Schedule $schedule) |
|
33 | - { |
|
34 | - // $schedule->command('inspire') |
|
35 | - // ->hourly(); |
|
36 | - } |
|
26 | + /** |
|
27 | + * Define the application's command schedule. |
|
28 | + * |
|
29 | + * @param \Illuminate\Console\Scheduling\Schedule $schedule |
|
30 | + * @return void |
|
31 | + */ |
|
32 | + protected function schedule(Schedule $schedule) |
|
33 | + { |
|
34 | + // $schedule->command('inspire') |
|
35 | + // ->hourly(); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Register the commands for the application. |
|
40 | - * |
|
41 | - * @return void |
|
42 | - */ |
|
43 | - protected function commands() |
|
44 | - { |
|
45 | - $this->load(__DIR__.'/Commands'); |
|
38 | + /** |
|
39 | + * Register the commands for the application. |
|
40 | + * |
|
41 | + * @return void |
|
42 | + */ |
|
43 | + protected function commands() |
|
44 | + { |
|
45 | + $this->load(__DIR__.'/Commands'); |
|
46 | 46 | |
47 | - require base_path('routes/console.php'); |
|
48 | - } |
|
47 | + require base_path('routes/console.php'); |
|
48 | + } |
|
49 | 49 | } |
@@ -11,5 +11,5 @@ |
||
11 | 11 | | |
12 | 12 | */ |
13 | 13 | if (\App::environment('local')) { |
14 | - Route::get('/docs', 'ApiDocumentController@index'); |
|
14 | + Route::get('/docs', 'ApiDocumentController@index'); |
|
15 | 15 | } |
@@ -9,16 +9,16 @@ |
||
9 | 9 | class Report extends Model |
10 | 10 | { |
11 | 11 | |
12 | - use SoftDeletes; |
|
13 | - protected $table = 'reports'; |
|
14 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
15 | - protected $hidden = ['deleted_at']; |
|
16 | - protected $guarded = ['id']; |
|
17 | - public $fillable = ['report_name', 'view_name']; |
|
12 | + use SoftDeletes; |
|
13 | + protected $table = 'reports'; |
|
14 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
15 | + protected $hidden = ['deleted_at']; |
|
16 | + protected $guarded = ['id']; |
|
17 | + public $fillable = ['report_name', 'view_name']; |
|
18 | 18 | |
19 | - public static function boot() |
|
20 | - { |
|
21 | - parent::boot(); |
|
22 | - Report::observe(ReportObserver::class); |
|
23 | - } |
|
19 | + public static function boot() |
|
20 | + { |
|
21 | + parent::boot(); |
|
22 | + Report::observe(ReportObserver::class); |
|
23 | + } |
|
24 | 24 | } |
@@ -15,29 +15,29 @@ |
||
15 | 15 | |
16 | 16 | Route::group(['prefix' => 'users'], function () { |
17 | 17 | |
18 | - Route::get('/', 'UserController@index'); |
|
19 | - Route::get('{id}', 'UserController@show'); |
|
20 | - Route::post('/', 'UserController@store'); |
|
21 | - Route::patch('{id}', 'UserController@update'); |
|
22 | - Route::delete('{id}', 'UserController@destroy'); |
|
23 | - Route::patch('restore/{id}', 'UserController@restore'); |
|
24 | - Route::patch('block/{id}', 'UserController@block'); |
|
25 | - Route::patch('unblock/{id}', 'UserController@unblock'); |
|
26 | - Route::patch('assign/roles/{id}', 'UserController@assignRoles'); |
|
18 | + Route::get('/', 'UserController@index'); |
|
19 | + Route::get('{id}', 'UserController@show'); |
|
20 | + Route::post('/', 'UserController@store'); |
|
21 | + Route::patch('{id}', 'UserController@update'); |
|
22 | + Route::delete('{id}', 'UserController@destroy'); |
|
23 | + Route::patch('restore/{id}', 'UserController@restore'); |
|
24 | + Route::patch('block/{id}', 'UserController@block'); |
|
25 | + Route::patch('unblock/{id}', 'UserController@unblock'); |
|
26 | + Route::patch('assign/roles/{id}', 'UserController@assignRoles'); |
|
27 | 27 | |
28 | - Route::group(['prefix' => 'account'], function () { |
|
28 | + Route::group(['prefix' => 'account'], function () { |
|
29 | 29 | |
30 | - Route::get('my', 'UserController@account'); |
|
31 | - Route::get('logout', 'UserController@logout'); |
|
32 | - Route::post('refresh/token', 'UserController@refreshToken'); |
|
33 | - Route::post('save', 'UserController@saveProfile'); |
|
34 | - Route::post('register', 'UserController@register'); |
|
35 | - Route::post('login', 'UserController@login'); |
|
36 | - Route::post('login/social', 'UserController@loginSocial'); |
|
37 | - Route::post('send/reset', 'UserController@sendReset'); |
|
38 | - Route::post('reset/password', 'UserController@resetPassword'); |
|
39 | - Route::post('change/password', 'UserController@changePassword'); |
|
40 | - Route::post('confirm/email', 'UserController@confirmEmail'); |
|
41 | - Route::post('resend/email/confirmation', 'UserController@resendEmailConfirmation'); |
|
42 | - }); |
|
30 | + Route::get('my', 'UserController@account'); |
|
31 | + Route::get('logout', 'UserController@logout'); |
|
32 | + Route::post('refresh/token', 'UserController@refreshToken'); |
|
33 | + Route::post('save', 'UserController@saveProfile'); |
|
34 | + Route::post('register', 'UserController@register'); |
|
35 | + Route::post('login', 'UserController@login'); |
|
36 | + Route::post('login/social', 'UserController@loginSocial'); |
|
37 | + Route::post('send/reset', 'UserController@sendReset'); |
|
38 | + Route::post('reset/password', 'UserController@resetPassword'); |
|
39 | + Route::post('change/password', 'UserController@changePassword'); |
|
40 | + Route::post('confirm/email', 'UserController@confirmEmail'); |
|
41 | + Route::post('resend/email/confirmation', 'UserController@resendEmailConfirmation'); |
|
42 | + }); |
|
43 | 43 | }); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | -Route::group(['prefix' => 'users'], function () { |
|
16 | +Route::group(['prefix' => 'users'], function() { |
|
17 | 17 | |
18 | 18 | Route::get('/', 'UserController@index'); |
19 | 19 | Route::get('{id}', 'UserController@show'); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | Route::patch('unblock/{id}', 'UserController@unblock'); |
26 | 26 | Route::patch('assign/roles/{id}', 'UserController@assignRoles'); |
27 | 27 | |
28 | - Route::group(['prefix' => 'account'], function () { |
|
28 | + Route::group(['prefix' => 'account'], function() { |
|
29 | 29 | |
30 | 30 | Route::get('my', 'UserController@account'); |
31 | 31 | Route::get('logout', 'UserController@logout'); |
@@ -10,21 +10,21 @@ |
||
10 | 10 | class Permission extends Model |
11 | 11 | { |
12 | 12 | |
13 | - use SoftDeletes; |
|
14 | - protected $table = 'permissions'; |
|
15 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
16 | - protected $hidden = ['deleted_at']; |
|
17 | - protected $guarded = ['id']; |
|
18 | - public $fillable = ['name', 'model']; |
|
13 | + use SoftDeletes; |
|
14 | + protected $table = 'permissions'; |
|
15 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
16 | + protected $hidden = ['deleted_at']; |
|
17 | + protected $guarded = ['id']; |
|
18 | + public $fillable = ['name', 'model']; |
|
19 | 19 | |
20 | - public function roles() |
|
21 | - { |
|
22 | - return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
23 | - } |
|
20 | + public function roles() |
|
21 | + { |
|
22 | + return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
23 | + } |
|
24 | 24 | |
25 | - public static function boot() |
|
26 | - { |
|
27 | - parent::boot(); |
|
28 | - Permission::observe(PermissionObserver::class); |
|
29 | - } |
|
25 | + public static function boot() |
|
26 | + { |
|
27 | + parent::boot(); |
|
28 | + Permission::observe(PermissionObserver::class); |
|
29 | + } |
|
30 | 30 | } |