@@ -6,30 +6,30 @@ |
||
6 | 6 | |
7 | 7 | class ModuleServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | - /** |
|
10 | - * Bootstrap the module services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'permissions'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'permissions'); |
|
9 | + /** |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'permissions'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'permissions'); |
|
18 | 18 | |
19 | - $this->loadMigrationsFrom(module_path('permissions', 'Database/Migrations', 'app')); |
|
20 | - $this->loadFactoriesFrom(module_path('permissions', 'Database/Factories', 'app')); |
|
21 | - if (!$this->app->configurationIsCached()) { |
|
22 | - $this->loadConfigsFrom(module_path('permissions', 'Config', 'app')); |
|
23 | - } |
|
24 | - } |
|
19 | + $this->loadMigrationsFrom(module_path('permissions', 'Database/Migrations', 'app')); |
|
20 | + $this->loadFactoriesFrom(module_path('permissions', 'Database/Factories', 'app')); |
|
21 | + if (!$this->app->configurationIsCached()) { |
|
22 | + $this->loadConfigsFrom(module_path('permissions', 'Config', 'app')); |
|
23 | + } |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Register the module services. |
|
28 | - * |
|
29 | - * @return void |
|
30 | - */ |
|
31 | - public function register() |
|
32 | - { |
|
33 | - $this->app->register(RouteServiceProvider::class); |
|
34 | - } |
|
26 | + /** |
|
27 | + * Register the module services. |
|
28 | + * |
|
29 | + * @return void |
|
30 | + */ |
|
31 | + public function register() |
|
32 | + { |
|
33 | + $this->app->register(RouteServiceProvider::class); |
|
34 | + } |
|
35 | 35 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | $this->loadMigrationsFrom(module_path('permissions', 'Database/Migrations', 'app')); |
20 | 20 | $this->loadFactoriesFrom(module_path('permissions', 'Database/Factories', 'app')); |
21 | - if (!$this->app->configurationIsCached()) { |
|
21 | + if ( ! $this->app->configurationIsCached()) { |
|
22 | 22 | $this->loadConfigsFrom(module_path('permissions', 'Config', 'app')); |
23 | 23 | } |
24 | 24 | } |
@@ -6,30 +6,30 @@ |
||
6 | 6 | |
7 | 7 | class ModuleServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | - /** |
|
10 | - * Bootstrap the module services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'users'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'users'); |
|
9 | + /** |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'users'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'users'); |
|
18 | 18 | |
19 | - $this->loadMigrationsFrom(module_path('users', 'Database/Migrations', 'app')); |
|
20 | - $this->loadFactoriesFrom(module_path('users', 'Database/Factories', 'app')); |
|
21 | - if (!$this->app->configurationIsCached()) { |
|
22 | - $this->loadConfigsFrom(module_path('users', 'Config', 'app')); |
|
23 | - } |
|
24 | - } |
|
19 | + $this->loadMigrationsFrom(module_path('users', 'Database/Migrations', 'app')); |
|
20 | + $this->loadFactoriesFrom(module_path('users', 'Database/Factories', 'app')); |
|
21 | + if (!$this->app->configurationIsCached()) { |
|
22 | + $this->loadConfigsFrom(module_path('users', 'Config', 'app')); |
|
23 | + } |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Register the module services. |
|
28 | - * |
|
29 | - * @return void |
|
30 | - */ |
|
31 | - public function register() |
|
32 | - { |
|
33 | - $this->app->register(RouteServiceProvider::class); |
|
34 | - } |
|
26 | + /** |
|
27 | + * Register the module services. |
|
28 | + * |
|
29 | + * @return void |
|
30 | + */ |
|
31 | + public function register() |
|
32 | + { |
|
33 | + $this->app->register(RouteServiceProvider::class); |
|
34 | + } |
|
35 | 35 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | $this->loadMigrationsFrom(module_path('users', 'Database/Migrations', 'app')); |
20 | 20 | $this->loadFactoriesFrom(module_path('users', 'Database/Factories', 'app')); |
21 | - if (!$this->app->configurationIsCached()) { |
|
21 | + if ( ! $this->app->configurationIsCached()) { |
|
22 | 22 | $this->loadConfigsFrom(module_path('users', 'Config', 'app')); |
23 | 23 | } |
24 | 24 | } |
@@ -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 | } |
@@ -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 | } |
@@ -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 | - public $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 | + public $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 | } |
@@ -10,32 +10,32 @@ |
||
10 | 10 | class PushNotificationDevice extends Model |
11 | 11 | { |
12 | 12 | |
13 | - use SoftDeletes; |
|
14 | - protected $table = 'push_notification_devices'; |
|
15 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
16 | - protected $hidden = ['deleted_at', 'access_token']; |
|
17 | - protected $guarded = ['id']; |
|
18 | - public $fillable = ['device_token', 'user_id', 'access_token']; |
|
13 | + use SoftDeletes; |
|
14 | + protected $table = 'push_notification_devices'; |
|
15 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
16 | + protected $hidden = ['deleted_at', 'access_token']; |
|
17 | + protected $guarded = ['id']; |
|
18 | + public $fillable = ['device_token', 'user_id', 'access_token']; |
|
19 | 19 | |
20 | - public function user() |
|
21 | - { |
|
22 | - return $this->belongsTo(AclUser::class); |
|
23 | - } |
|
20 | + public function user() |
|
21 | + { |
|
22 | + return $this->belongsTo(AclUser::class); |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * Encrypt the access_token attribute before |
|
27 | - * saving it in the storage. |
|
28 | - * |
|
29 | - * @param string $value |
|
30 | - */ |
|
31 | - public function setLoginTokenAttribute($value) |
|
32 | - { |
|
33 | - $this->attributes['access_token'] = encrypt($value); |
|
34 | - } |
|
25 | + /** |
|
26 | + * Encrypt the access_token attribute before |
|
27 | + * saving it in the storage. |
|
28 | + * |
|
29 | + * @param string $value |
|
30 | + */ |
|
31 | + public function setLoginTokenAttribute($value) |
|
32 | + { |
|
33 | + $this->attributes['access_token'] = encrypt($value); |
|
34 | + } |
|
35 | 35 | |
36 | - public static function boot() |
|
37 | - { |
|
38 | - parent::boot(); |
|
39 | - PushNotificationDevice::observe(PushNotificationDeviceObserver::class); |
|
40 | - } |
|
36 | + public static function boot() |
|
37 | + { |
|
38 | + parent::boot(); |
|
39 | + PushNotificationDevice::observe(PushNotificationDeviceObserver::class); |
|
40 | + } |
|
41 | 41 | } |
@@ -6,64 +6,64 @@ |
||
6 | 6 | |
7 | 7 | class PushNotificationDevicesTableSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - /** |
|
17 | - * Insert the permissions related to settings table. |
|
18 | - */ |
|
19 | - \DB::table('permissions')->insert( |
|
20 | - [ |
|
21 | - /** |
|
22 | - * pushNotificationDevices model permissions. |
|
23 | - */ |
|
24 | - [ |
|
25 | - 'name' => 'index', |
|
26 | - 'model' => 'pushNotificationDevice', |
|
27 | - 'created_at' => \DB::raw('NOW()'), |
|
28 | - 'updated_at' => \DB::raw('NOW()') |
|
29 | - ], |
|
30 | - [ |
|
31 | - 'name' => 'show', |
|
32 | - 'model' => 'pushNotificationDevice', |
|
33 | - 'created_at' => \DB::raw('NOW()'), |
|
34 | - 'updated_at' => \DB::raw('NOW()') |
|
35 | - ], |
|
36 | - [ |
|
37 | - 'name' => 'store', |
|
38 | - 'model' => 'pushNotificationDevice', |
|
39 | - 'created_at' => \DB::raw('NOW()'), |
|
40 | - 'updated_at' => \DB::raw('NOW()') |
|
41 | - ], |
|
42 | - [ |
|
43 | - 'name' => 'update', |
|
44 | - 'model' => 'pushNotificationDevice', |
|
45 | - 'created_at' => \DB::raw('NOW()'), |
|
46 | - 'updated_at' => \DB::raw('NOW()') |
|
47 | - ], |
|
48 | - [ |
|
49 | - 'name' => 'destroy', |
|
50 | - 'model' => 'pushNotificationDevice', |
|
51 | - 'created_at' => \DB::raw('NOW()'), |
|
52 | - 'updated_at' => \DB::raw('NOW()') |
|
53 | - ], |
|
54 | - [ |
|
55 | - 'name' => 'deleted', |
|
56 | - 'model' => 'pushNotificationDevice', |
|
57 | - 'created_at' => \DB::raw('NOW()'), |
|
58 | - 'updated_at' => \DB::raw('NOW()') |
|
59 | - ], |
|
60 | - [ |
|
61 | - 'name' => 'restore', |
|
62 | - 'model' => 'pushNotificationDevice', |
|
63 | - 'created_at' => \DB::raw('NOW()'), |
|
64 | - 'updated_at' => \DB::raw('NOW()') |
|
65 | - ] |
|
66 | - ] |
|
67 | - ); |
|
68 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + /** |
|
17 | + * Insert the permissions related to settings table. |
|
18 | + */ |
|
19 | + \DB::table('permissions')->insert( |
|
20 | + [ |
|
21 | + /** |
|
22 | + * pushNotificationDevices model permissions. |
|
23 | + */ |
|
24 | + [ |
|
25 | + 'name' => 'index', |
|
26 | + 'model' => 'pushNotificationDevice', |
|
27 | + 'created_at' => \DB::raw('NOW()'), |
|
28 | + 'updated_at' => \DB::raw('NOW()') |
|
29 | + ], |
|
30 | + [ |
|
31 | + 'name' => 'show', |
|
32 | + 'model' => 'pushNotificationDevice', |
|
33 | + 'created_at' => \DB::raw('NOW()'), |
|
34 | + 'updated_at' => \DB::raw('NOW()') |
|
35 | + ], |
|
36 | + [ |
|
37 | + 'name' => 'store', |
|
38 | + 'model' => 'pushNotificationDevice', |
|
39 | + 'created_at' => \DB::raw('NOW()'), |
|
40 | + 'updated_at' => \DB::raw('NOW()') |
|
41 | + ], |
|
42 | + [ |
|
43 | + 'name' => 'update', |
|
44 | + 'model' => 'pushNotificationDevice', |
|
45 | + 'created_at' => \DB::raw('NOW()'), |
|
46 | + 'updated_at' => \DB::raw('NOW()') |
|
47 | + ], |
|
48 | + [ |
|
49 | + 'name' => 'destroy', |
|
50 | + 'model' => 'pushNotificationDevice', |
|
51 | + 'created_at' => \DB::raw('NOW()'), |
|
52 | + 'updated_at' => \DB::raw('NOW()') |
|
53 | + ], |
|
54 | + [ |
|
55 | + 'name' => 'deleted', |
|
56 | + 'model' => 'pushNotificationDevice', |
|
57 | + 'created_at' => \DB::raw('NOW()'), |
|
58 | + 'updated_at' => \DB::raw('NOW()') |
|
59 | + ], |
|
60 | + [ |
|
61 | + 'name' => 'restore', |
|
62 | + 'model' => 'pushNotificationDevice', |
|
63 | + 'created_at' => \DB::raw('NOW()'), |
|
64 | + 'updated_at' => \DB::raw('NOW()') |
|
65 | + ] |
|
66 | + ] |
|
67 | + ); |
|
68 | + } |
|
69 | 69 | } |
@@ -8,17 +8,17 @@ |
||
8 | 8 | |
9 | 9 | class OauthClient extends Client |
10 | 10 | { |
11 | - protected $dates = ['created_at', 'updated_at']; |
|
12 | - public $fillable = ['name', 'redirect', 'user_id', 'personal_access_client', 'password_client', 'revoked']; |
|
11 | + protected $dates = ['created_at', 'updated_at']; |
|
12 | + public $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 | } |
@@ -8,40 +8,40 @@ |
||
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('Accept-Language', 'en'); |
|
38 | - $locale = $locale == 'ar' || $locale == 'all' ? $locale : 'en'; |
|
39 | - $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('Accept-Language', 'en'); |
|
38 | + $locale = $locale == 'ar' || $locale == 'all' ? $locale : 'en'; |
|
39 | + $timeZone = $request->header('time-zone', 0); |
|
40 | 40 | |
41 | - $this->session->put('time-zone', $timeZone); |
|
42 | - $this->session->put('locale', $locale); |
|
43 | - $this->app->setLocale($locale); |
|
41 | + $this->session->put('time-zone', $timeZone); |
|
42 | + $this->session->put('locale', $locale); |
|
43 | + $this->app->setLocale($locale); |
|
44 | 44 | |
45 | - return $next($request); |
|
46 | - } |
|
45 | + return $next($request); |
|
46 | + } |
|
47 | 47 | } |