@@ -8,16 +8,16 @@ |
||
8 | 8 | |
9 | 9 | class DummyModel extends Model |
10 | 10 | { |
11 | - use SoftDeletes; |
|
12 | - protected $table = 'DummyTableName'; |
|
13 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
14 | - protected $hidden = ['deleted_at']; |
|
15 | - protected $guarded = ['id']; |
|
16 | - protected $fillable = []; // Add attributes here |
|
11 | + use SoftDeletes; |
|
12 | + protected $table = 'DummyTableName'; |
|
13 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
14 | + protected $hidden = ['deleted_at']; |
|
15 | + protected $guarded = ['id']; |
|
16 | + protected $fillable = []; // Add attributes here |
|
17 | 17 | |
18 | - public static function boot() |
|
19 | - { |
|
20 | - parent::boot(); |
|
21 | - DummyModel::observe(DummyObserver::class); |
|
22 | - } |
|
18 | + public static function boot() |
|
19 | + { |
|
20 | + parent::boot(); |
|
21 | + DummyModel::observe(DummyObserver::class); |
|
22 | + } |
|
23 | 23 | } |
@@ -8,39 +8,39 @@ |
||
8 | 8 | |
9 | 9 | class SetSessions |
10 | 10 | { |
11 | - protected $app; |
|
12 | - protected $session; |
|
11 | + protected $app; |
|
12 | + protected $session; |
|
13 | 13 | |
14 | - /** |
|
15 | - * Init new object. |
|
16 | - * |
|
17 | - * @param App $app |
|
18 | - * @param Session $session |
|
19 | - * |
|
20 | - * @return void |
|
21 | - */ |
|
22 | - public function __construct(App $app, Session $session) |
|
23 | - { |
|
24 | - $this->app = $app; |
|
25 | - $this->session = $session; |
|
26 | - } |
|
14 | + /** |
|
15 | + * Init new object. |
|
16 | + * |
|
17 | + * @param App $app |
|
18 | + * @param Session $session |
|
19 | + * |
|
20 | + * @return void |
|
21 | + */ |
|
22 | + public function __construct(App $app, Session $session) |
|
23 | + { |
|
24 | + $this->app = $app; |
|
25 | + $this->session = $session; |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Handle an incoming request. |
|
30 | - * |
|
31 | - * @param \Illuminate\Http\Request $request |
|
32 | - * @param \Closure $next |
|
33 | - * @return mixed |
|
34 | - */ |
|
35 | - public function handle($request, Closure $next) |
|
36 | - { |
|
37 | - $locale = $request->header('locale', 'en'); |
|
38 | - $timeZone = $request->header('time-zone', 0); |
|
28 | + /** |
|
29 | + * Handle an incoming request. |
|
30 | + * |
|
31 | + * @param \Illuminate\Http\Request $request |
|
32 | + * @param \Closure $next |
|
33 | + * @return mixed |
|
34 | + */ |
|
35 | + public function handle($request, Closure $next) |
|
36 | + { |
|
37 | + $locale = $request->header('locale', 'en'); |
|
38 | + $timeZone = $request->header('time-zone', 0); |
|
39 | 39 | |
40 | - $this->session->put('time-zone', $timeZone); |
|
41 | - $this->session->put('locale', $locale); |
|
42 | - $this->app->setLocale($locale); |
|
40 | + $this->session->put('time-zone', $timeZone); |
|
41 | + $this->session->put('locale', $locale); |
|
42 | + $this->app->setLocale($locale); |
|
43 | 43 | |
44 | - return $next($request); |
|
45 | - } |
|
44 | + return $next($request); |
|
45 | + } |
|
46 | 46 | } |
@@ -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 | - protected $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 | + protected $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 | } |
@@ -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 | - protected $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 | + protected $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 | } |
@@ -6,5 +6,5 @@ |
||
6 | 6 | |
7 | 7 | class Notification extends DatabaseNotification |
8 | 8 | { |
9 | - // |
|
9 | + // |
|
10 | 10 | } |
@@ -6,26 +6,26 @@ |
||
6 | 6 | |
7 | 7 | class Login extends FormRequest |
8 | 8 | { |
9 | - /** |
|
10 | - * Determine if the user is authorized to make this request. |
|
11 | - * |
|
12 | - * @return bool |
|
13 | - */ |
|
14 | - public function authorize() |
|
15 | - { |
|
16 | - return true; |
|
17 | - } |
|
9 | + /** |
|
10 | + * Determine if the user is authorized to make this request. |
|
11 | + * |
|
12 | + * @return bool |
|
13 | + */ |
|
14 | + public function authorize() |
|
15 | + { |
|
16 | + return true; |
|
17 | + } |
|
18 | 18 | |
19 | - /** |
|
20 | - * Get the validation rules that apply to the request. |
|
21 | - * |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function rules() |
|
25 | - { |
|
26 | - return [ |
|
27 | - 'email' => 'required|email', |
|
28 | - 'password' => 'required|min:6' |
|
29 | - ]; |
|
30 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + return [ |
|
27 | + 'email' => 'required|email', |
|
28 | + 'password' => 'required|min:6' |
|
29 | + ]; |
|
30 | + } |
|
31 | 31 | } |
@@ -8,17 +8,17 @@ |
||
8 | 8 | |
9 | 9 | class OauthClient extends Client |
10 | 10 | { |
11 | - protected $dates = ['created_at', 'updated_at']; |
|
12 | - protected $fillable = ['name', 'redirect', 'user_id', 'personal_access_client', 'password_client', 'revoked']; |
|
11 | + protected $dates = ['created_at', 'updated_at']; |
|
12 | + protected $fillable = ['name', 'redirect', 'user_id', 'personal_access_client', 'password_client', 'revoked']; |
|
13 | 13 | |
14 | - public function user() |
|
15 | - { |
|
16 | - return $this->belongsTo(AclUser::class); |
|
17 | - } |
|
14 | + public function user() |
|
15 | + { |
|
16 | + return $this->belongsTo(AclUser::class); |
|
17 | + } |
|
18 | 18 | |
19 | - public static function boot() |
|
20 | - { |
|
21 | - parent::boot(); |
|
22 | - OauthClient::observe(OauthClientObserver::class); |
|
23 | - } |
|
19 | + public static function boot() |
|
20 | + { |
|
21 | + parent::boot(); |
|
22 | + OauthClient::observe(OauthClientObserver::class); |
|
23 | + } |
|
24 | 24 | } |
@@ -11,26 +11,26 @@ |
||
11 | 11 | class Role extends Model |
12 | 12 | { |
13 | 13 | |
14 | - use SoftDeletes; |
|
15 | - protected $table = 'roles'; |
|
16 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
17 | - protected $hidden = ['deleted_at']; |
|
18 | - protected $guarded = ['id']; |
|
19 | - protected $fillable = ['name']; |
|
14 | + use SoftDeletes; |
|
15 | + protected $table = 'roles'; |
|
16 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
17 | + protected $hidden = ['deleted_at']; |
|
18 | + protected $guarded = ['id']; |
|
19 | + protected $fillable = ['name']; |
|
20 | 20 | |
21 | - public function users() |
|
22 | - { |
|
23 | - return $this->belongsToMany(AclUser::class, 'role_user', 'role_id', 'user_id')->whereNull('role_user.deleted_at')->withTimestamps(); |
|
24 | - } |
|
21 | + public function users() |
|
22 | + { |
|
23 | + return $this->belongsToMany(AclUser::class, 'role_user', 'role_id', 'user_id')->whereNull('role_user.deleted_at')->withTimestamps(); |
|
24 | + } |
|
25 | 25 | |
26 | - public function permissions() |
|
27 | - { |
|
28 | - return $this->belongsToMany(Permission::class, 'permission_role', 'role_id', 'permission_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
29 | - } |
|
26 | + public function permissions() |
|
27 | + { |
|
28 | + return $this->belongsToMany(Permission::class, 'permission_role', 'role_id', 'permission_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
29 | + } |
|
30 | 30 | |
31 | - public static function boot() |
|
32 | - { |
|
33 | - parent::boot(); |
|
34 | - Role::observe(RoleObserver::class); |
|
35 | - } |
|
31 | + public static function boot() |
|
32 | + { |
|
33 | + parent::boot(); |
|
34 | + Role::observe(RoleObserver::class); |
|
35 | + } |
|
36 | 36 | } |
@@ -5,8 +5,6 @@ |
||
5 | 5 | use App\Modules\Core\BaseClasses\BaseApiController; |
6 | 6 | use App\Modules\Roles\Services\RoleService; |
7 | 7 | use App\Modules\Roles\Http\Requests\AssignPermissions; |
8 | -use App\Modules\Roles\Http\Requests\InsertRole; |
|
9 | -use App\Modules\Roles\Http\Requests\UpdateRole; |
|
10 | 8 | |
11 | 9 | class RoleController extends BaseApiController |
12 | 10 | { |
@@ -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 | } |