@@ -3,9 +3,6 @@ |
||
3 | 3 | namespace App\Modules\PushNotificationDevices\Repositories; |
4 | 4 | |
5 | 5 | use App\Modules\Core\BaseClasses\BaseRepository; |
6 | -use LaravelFCM\Message\OptionsBuilder; |
|
7 | -use LaravelFCM\Message\PayloadDataBuilder; |
|
8 | -use LaravelFCM\Message\PayloadNotificationBuilder; |
|
9 | 6 | use App\Modules\PushNotificationDevices\PushNotificationDevice; |
10 | 7 | |
11 | 8 | class PushNotificationDeviceRepository extends BaseRepository |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace App\Modules\Users\Repositories; |
4 | 4 | |
5 | 5 | use App\Modules\Core\BaseClasses\BaseRepository; |
6 | -use Illuminate\Support\Arr; |
|
7 | 6 | use App\Modules\Users\AclUser; |
8 | 7 | |
9 | 8 | class UserRepository extends BaseRepository |
@@ -7,67 +7,67 @@ |
||
7 | 7 | |
8 | 8 | class Handler extends ExceptionHandler |
9 | 9 | { |
10 | - /** |
|
11 | - * A list of the exception types that are not reported. |
|
12 | - * |
|
13 | - * @var array |
|
14 | - */ |
|
15 | - protected $dontReport = [ |
|
16 | - \League\OAuth2\Server\Exception\OAuthServerException::class, |
|
17 | - ]; |
|
10 | + /** |
|
11 | + * A list of the exception types that are not reported. |
|
12 | + * |
|
13 | + * @var array |
|
14 | + */ |
|
15 | + protected $dontReport = [ |
|
16 | + \League\OAuth2\Server\Exception\OAuthServerException::class, |
|
17 | + ]; |
|
18 | 18 | |
19 | - /** |
|
20 | - * A list of the inputs that are never flashed for validation exceptions. |
|
21 | - * |
|
22 | - * @var array |
|
23 | - */ |
|
24 | - protected $dontFlash = [ |
|
25 | - 'password', |
|
26 | - 'password_confirmation', |
|
27 | - ]; |
|
19 | + /** |
|
20 | + * A list of the inputs that are never flashed for validation exceptions. |
|
21 | + * |
|
22 | + * @var array |
|
23 | + */ |
|
24 | + protected $dontFlash = [ |
|
25 | + 'password', |
|
26 | + 'password_confirmation', |
|
27 | + ]; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Report or log an exception. |
|
31 | - * |
|
32 | - * This is a great spot to send exceptions to Sentry, Bugsnag, etc. |
|
33 | - * |
|
34 | - * @param \Exception $exception |
|
35 | - * @return void |
|
36 | - */ |
|
37 | - public function report(Exception $exception) |
|
38 | - { |
|
39 | - parent::report($exception); |
|
40 | - } |
|
29 | + /** |
|
30 | + * Report or log an exception. |
|
31 | + * |
|
32 | + * This is a great spot to send exceptions to Sentry, Bugsnag, etc. |
|
33 | + * |
|
34 | + * @param \Exception $exception |
|
35 | + * @return void |
|
36 | + */ |
|
37 | + public function report(Exception $exception) |
|
38 | + { |
|
39 | + parent::report($exception); |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * Render an exception into an HTTP response. |
|
44 | - * |
|
45 | - * @param \Illuminate\Http\Request $request |
|
46 | - * @param \Exception $exception |
|
47 | - * @return \Illuminate\Http\Response |
|
48 | - */ |
|
49 | - public function render($request, Exception $exception) |
|
50 | - { |
|
51 | - if ($request->wantsJson()) { |
|
52 | - if ($exception instanceof \Illuminate\Auth\AuthenticationException) { |
|
53 | - \Errors::unAuthorized(); |
|
54 | - } |
|
55 | - if ($exception instanceof \Illuminate\Database\QueryException) { |
|
56 | - \Errors::dbQueryError(); |
|
57 | - } elseif ($exception instanceof \predis\connection\connectionexception) { |
|
58 | - \Errors::redisNotRunning(); |
|
59 | - } elseif ($exception instanceof \GuzzleHttp\Exception\ClientException) { |
|
60 | - \Errors::connectionError(); |
|
61 | - } elseif ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException) { |
|
62 | - $errors = $exception->getStatusCode() === 404 ? 'not found' : $exception->getMessage(); |
|
63 | - return \Response::json(['errors' => [$errors]], $exception->getStatusCode()); |
|
64 | - } elseif ($exception instanceof \Illuminate\Validation\ValidationException) { |
|
65 | - return \Response::json(['errors' => $exception->errors()], 422); |
|
66 | - } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) { |
|
67 | - return parent::render($request, $exception); |
|
68 | - } |
|
69 | - } |
|
42 | + /** |
|
43 | + * Render an exception into an HTTP response. |
|
44 | + * |
|
45 | + * @param \Illuminate\Http\Request $request |
|
46 | + * @param \Exception $exception |
|
47 | + * @return \Illuminate\Http\Response |
|
48 | + */ |
|
49 | + public function render($request, Exception $exception) |
|
50 | + { |
|
51 | + if ($request->wantsJson()) { |
|
52 | + if ($exception instanceof \Illuminate\Auth\AuthenticationException) { |
|
53 | + \Errors::unAuthorized(); |
|
54 | + } |
|
55 | + if ($exception instanceof \Illuminate\Database\QueryException) { |
|
56 | + \Errors::dbQueryError(); |
|
57 | + } elseif ($exception instanceof \predis\connection\connectionexception) { |
|
58 | + \Errors::redisNotRunning(); |
|
59 | + } elseif ($exception instanceof \GuzzleHttp\Exception\ClientException) { |
|
60 | + \Errors::connectionError(); |
|
61 | + } elseif ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException) { |
|
62 | + $errors = $exception->getStatusCode() === 404 ? 'not found' : $exception->getMessage(); |
|
63 | + return \Response::json(['errors' => [$errors]], $exception->getStatusCode()); |
|
64 | + } elseif ($exception instanceof \Illuminate\Validation\ValidationException) { |
|
65 | + return \Response::json(['errors' => $exception->errors()], 422); |
|
66 | + } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) { |
|
67 | + return parent::render($request, $exception); |
|
68 | + } |
|
69 | + } |
|
70 | 70 | |
71 | - return parent::render($request, $exception); |
|
72 | - } |
|
71 | + return parent::render($request, $exception); |
|
72 | + } |
|
73 | 73 | } |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * Here goes your error messages. |
|
7 | - */ |
|
5 | + /** |
|
6 | + * Here goes your error messages. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | ]; |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * Here goes your error messages. |
|
7 | - */ |
|
5 | + /** |
|
6 | + * Here goes your error messages. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | ]; |
@@ -10,36 +10,36 @@ |
||
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']; |
|
19 | - |
|
20 | - public function getCreatedAtAttribute($value) |
|
21 | - { |
|
22 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
23 | - } |
|
24 | - |
|
25 | - public function getUpdatedAtAttribute($value) |
|
26 | - { |
|
27 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
28 | - } |
|
29 | - |
|
30 | - public function getDeletedAtAttribute($value) |
|
31 | - { |
|
32 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
33 | - } |
|
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 | + |
|
20 | + public function getCreatedAtAttribute($value) |
|
21 | + { |
|
22 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
23 | + } |
|
24 | + |
|
25 | + public function getUpdatedAtAttribute($value) |
|
26 | + { |
|
27 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
28 | + } |
|
29 | + |
|
30 | + public function getDeletedAtAttribute($value) |
|
31 | + { |
|
32 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
33 | + } |
|
34 | 34 | |
35 | - public function roles() |
|
36 | - { |
|
37 | - return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
38 | - } |
|
39 | - |
|
40 | - public static function boot() |
|
41 | - { |
|
42 | - parent::boot(); |
|
43 | - Permission::observe(PermissionObserver::class); |
|
44 | - } |
|
35 | + public function roles() |
|
36 | + { |
|
37 | + return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
38 | + } |
|
39 | + |
|
40 | + public static function boot() |
|
41 | + { |
|
42 | + parent::boot(); |
|
43 | + Permission::observe(PermissionObserver::class); |
|
44 | + } |
|
45 | 45 | } |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * Here goes your error messages. |
|
7 | - */ |
|
5 | + /** |
|
6 | + * Here goes your error messages. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | ]; |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * Here goes your error messages. |
|
7 | - */ |
|
5 | + /** |
|
6 | + * Here goes your error messages. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | ]; |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * Here goes your error messages. |
|
7 | - */ |
|
5 | + /** |
|
6 | + * Here goes your error messages. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | ]; |