@@ -2,9 +2,9 @@ discard block |
||
2 | 2 | |
3 | 3 | class CoreConfig |
4 | 4 | { |
5 | - public function getConfig() |
|
6 | - { |
|
7 | - return [ |
|
5 | + public function getConfig() |
|
6 | + { |
|
7 | + return [ |
|
8 | 8 | /** |
9 | 9 | * Specify what relations should be used for every model. |
10 | 10 | */ |
@@ -14,5 +14,5 @@ discard block |
||
14 | 14 | */ |
15 | 15 | 'cacheConfig' => config('skeleton.cache_config'), |
16 | 16 | ]; |
17 | - } |
|
17 | + } |
|
18 | 18 | } |
19 | 19 | \ No newline at end of file |
@@ -6,38 +6,38 @@ |
||
6 | 6 | |
7 | 7 | class ApiSkeletonServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | - /** |
|
10 | - * Perform post-registration booting of services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->publishes([ |
|
17 | - __DIR__.'/Modules' => app_path('Modules'), |
|
18 | - __DIR__.'/Modules/Core/Resources/Assets' => base_path('public/doc/assets'), |
|
19 | - __DIR__.'/../lang' => base_path('resources/lang'), |
|
20 | - __DIR__.'/../files/Handler.php' => app_path('Exceptions/Handler.php'), |
|
21 | - __DIR__.'/../files/AuthServiceProvider.php' => app_path('Providers/AuthServiceProvider.php'), |
|
22 | - __DIR__.'/../files/BroadcastServiceProvider.php' => app_path('Providers/BroadcastServiceProvider.php'), |
|
23 | - __DIR__.'/../files/Kernel.php' => app_path('Console/Kernel.php'), |
|
24 | - ]); |
|
9 | + /** |
|
10 | + * Perform post-registration booting of services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->publishes([ |
|
17 | + __DIR__.'/Modules' => app_path('Modules'), |
|
18 | + __DIR__.'/Modules/Core/Resources/Assets' => base_path('public/doc/assets'), |
|
19 | + __DIR__.'/../lang' => base_path('resources/lang'), |
|
20 | + __DIR__.'/../files/Handler.php' => app_path('Exceptions/Handler.php'), |
|
21 | + __DIR__.'/../files/AuthServiceProvider.php' => app_path('Providers/AuthServiceProvider.php'), |
|
22 | + __DIR__.'/../files/BroadcastServiceProvider.php' => app_path('Providers/BroadcastServiceProvider.php'), |
|
23 | + __DIR__.'/../files/Kernel.php' => app_path('Console/Kernel.php'), |
|
24 | + ]); |
|
25 | 25 | |
26 | - $this->publishes([ |
|
27 | - __DIR__.'/../config/skeleton.php' => config_path('skeleton.php'), |
|
28 | - __DIR__.'/../files/auth.php' => config_path('auth.php'), |
|
29 | - ], 'config'); |
|
30 | - } |
|
26 | + $this->publishes([ |
|
27 | + __DIR__.'/../config/skeleton.php' => config_path('skeleton.php'), |
|
28 | + __DIR__.'/../files/auth.php' => config_path('auth.php'), |
|
29 | + ], 'config'); |
|
30 | + } |
|
31 | 31 | |
32 | - /** |
|
33 | - * Register any package services. |
|
34 | - * |
|
35 | - * @return void |
|
36 | - */ |
|
37 | - public function register() |
|
38 | - { |
|
39 | - $this->mergeConfigFrom( |
|
40 | - __DIR__.'/../config/skeleton.php', 'skeleton' |
|
41 | - ); |
|
42 | - } |
|
32 | + /** |
|
33 | + * Register any package services. |
|
34 | + * |
|
35 | + * @return void |
|
36 | + */ |
|
37 | + public function register() |
|
38 | + { |
|
39 | + $this->mergeConfigFrom( |
|
40 | + __DIR__.'/../config/skeleton.php', 'skeleton' |
|
41 | + ); |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | \ No newline at end of file |
@@ -2,117 +2,117 @@ |
||
2 | 2 | |
3 | 3 | class ErrorHandler |
4 | 4 | { |
5 | - public function unAuthorized() |
|
6 | - { |
|
7 | - $error = ['status' => 401, 'message' => trans('core::errors.unAuthorized')]; |
|
8 | - abort($error['status'], $error['message']); |
|
9 | - } |
|
10 | - |
|
11 | - public function invalidRefreshToken() |
|
12 | - { |
|
13 | - $error = ['status' => 400, 'message' => trans('core::errors.invalidRefreshToken')]; |
|
14 | - abort($error['status'], $error['message']); |
|
15 | - } |
|
16 | - |
|
17 | - public function noPermissions() |
|
18 | - { |
|
19 | - $error = ['status' => 403, 'message' => trans('core::errors.noPermissions')]; |
|
20 | - abort($error['status'], $error['message']); |
|
21 | - } |
|
22 | - |
|
23 | - public function loginFailed() |
|
24 | - { |
|
25 | - $error = ['status' => 400, 'message' => trans('core::errors.loginFailed')]; |
|
26 | - abort($error['status'], $error['message']); |
|
27 | - } |
|
28 | - |
|
29 | - public function noSocialEmail() |
|
30 | - { |
|
31 | - $error = ['status' => 400, 'message' => trans('core::errors.noSocialEmail')]; |
|
32 | - abort($error['status'], $error['message']); |
|
33 | - } |
|
34 | - |
|
35 | - public function userAlreadyRegistered() |
|
36 | - { |
|
37 | - $error = ['status' => 400, 'message' => trans('core::errors.userAlreadyRegistered')]; |
|
38 | - abort($error['status'], $error['message']); |
|
39 | - } |
|
40 | - |
|
41 | - public function connectionError() |
|
42 | - { |
|
43 | - $error = ['status' => 400, 'message' => trans('core::errors.connectionError')]; |
|
44 | - abort($error['status'], $error['message']); |
|
45 | - } |
|
46 | - |
|
47 | - public function redisNotRunning() |
|
48 | - { |
|
49 | - $error = ['status' => 400, 'message' => trans('core::errors.redisNotRunning')]; |
|
50 | - abort($error['status'], $error['message']); |
|
51 | - } |
|
52 | - |
|
53 | - public function dbQueryError() |
|
54 | - { |
|
55 | - $error = ['status' => 400, 'message' => trans('core::errors.dbQueryError')]; |
|
56 | - abort($error['status'], $error['message']); |
|
57 | - } |
|
58 | - |
|
59 | - public function cannotCreateSetting() |
|
60 | - { |
|
61 | - $error = ['status' => 400, 'message' => trans('core::errors.cannotCreateSetting')]; |
|
62 | - abort($error['status'], $error['message']); |
|
63 | - } |
|
64 | - |
|
65 | - public function cannotUpdateSettingKey() |
|
66 | - { |
|
67 | - $error = ['status' => 400, 'message' => trans('core::errors.cannotUpdateSettingKey')]; |
|
68 | - abort($error['status'], $error['message']); |
|
69 | - } |
|
70 | - |
|
71 | - public function userIsBlocked() |
|
72 | - { |
|
73 | - $error = ['status' => 403, 'message' => trans('core::errors.userIsBlocked')]; |
|
74 | - abort($error['status'], $error['message']); |
|
75 | - } |
|
76 | - |
|
77 | - public function emailNotConfirmed() |
|
78 | - { |
|
79 | - $error = ['status' => 403, 'message' => trans('core::errors.emailNotConfirmed')]; |
|
80 | - abort($error['status'], $error['message']); |
|
81 | - } |
|
82 | - |
|
83 | - public function emailAlreadyConfirmed() |
|
84 | - { |
|
85 | - $error = ['status' => 403, 'message' => trans('core::errors.emailAlreadyConfirmed')]; |
|
86 | - abort($error['status'], $error['message']); |
|
87 | - } |
|
88 | - |
|
89 | - public function invalidResetToken() |
|
90 | - { |
|
91 | - $error = ['status' => 400, 'message' => trans('core::errors.invalidResetToken')]; |
|
92 | - abort($error['status'], $error['message']); |
|
93 | - } |
|
94 | - |
|
95 | - public function invalidResetPassword() |
|
96 | - { |
|
97 | - $error = ['status' => 400, 'message' => trans('core::errors.invalidResetPassword')]; |
|
98 | - abort($error['status'], $error['message']); |
|
99 | - } |
|
100 | - |
|
101 | - public function invalidOldPassword() |
|
102 | - { |
|
103 | - $error = ['status' => 400, 'message' => trans('core::errors.invalidOldPassword')]; |
|
104 | - abort($error['status'], $error['message']); |
|
105 | - } |
|
106 | - |
|
107 | - public function notFound($text) |
|
108 | - { |
|
109 | - $error = ['status' => 404, 'message' => trans('core::errors.notFound', ['replace' => $text])]; |
|
110 | - abort($error['status'], $error['message']); |
|
111 | - } |
|
112 | - |
|
113 | - public function generalError() |
|
114 | - { |
|
115 | - $error = ['status' => 400, 'message' => trans('core::errors.generalError')]; |
|
116 | - abort($error['status'], $error['message']); |
|
117 | - } |
|
5 | + public function unAuthorized() |
|
6 | + { |
|
7 | + $error = ['status' => 401, 'message' => trans('core::errors.unAuthorized')]; |
|
8 | + abort($error['status'], $error['message']); |
|
9 | + } |
|
10 | + |
|
11 | + public function invalidRefreshToken() |
|
12 | + { |
|
13 | + $error = ['status' => 400, 'message' => trans('core::errors.invalidRefreshToken')]; |
|
14 | + abort($error['status'], $error['message']); |
|
15 | + } |
|
16 | + |
|
17 | + public function noPermissions() |
|
18 | + { |
|
19 | + $error = ['status' => 403, 'message' => trans('core::errors.noPermissions')]; |
|
20 | + abort($error['status'], $error['message']); |
|
21 | + } |
|
22 | + |
|
23 | + public function loginFailed() |
|
24 | + { |
|
25 | + $error = ['status' => 400, 'message' => trans('core::errors.loginFailed')]; |
|
26 | + abort($error['status'], $error['message']); |
|
27 | + } |
|
28 | + |
|
29 | + public function noSocialEmail() |
|
30 | + { |
|
31 | + $error = ['status' => 400, 'message' => trans('core::errors.noSocialEmail')]; |
|
32 | + abort($error['status'], $error['message']); |
|
33 | + } |
|
34 | + |
|
35 | + public function userAlreadyRegistered() |
|
36 | + { |
|
37 | + $error = ['status' => 400, 'message' => trans('core::errors.userAlreadyRegistered')]; |
|
38 | + abort($error['status'], $error['message']); |
|
39 | + } |
|
40 | + |
|
41 | + public function connectionError() |
|
42 | + { |
|
43 | + $error = ['status' => 400, 'message' => trans('core::errors.connectionError')]; |
|
44 | + abort($error['status'], $error['message']); |
|
45 | + } |
|
46 | + |
|
47 | + public function redisNotRunning() |
|
48 | + { |
|
49 | + $error = ['status' => 400, 'message' => trans('core::errors.redisNotRunning')]; |
|
50 | + abort($error['status'], $error['message']); |
|
51 | + } |
|
52 | + |
|
53 | + public function dbQueryError() |
|
54 | + { |
|
55 | + $error = ['status' => 400, 'message' => trans('core::errors.dbQueryError')]; |
|
56 | + abort($error['status'], $error['message']); |
|
57 | + } |
|
58 | + |
|
59 | + public function cannotCreateSetting() |
|
60 | + { |
|
61 | + $error = ['status' => 400, 'message' => trans('core::errors.cannotCreateSetting')]; |
|
62 | + abort($error['status'], $error['message']); |
|
63 | + } |
|
64 | + |
|
65 | + public function cannotUpdateSettingKey() |
|
66 | + { |
|
67 | + $error = ['status' => 400, 'message' => trans('core::errors.cannotUpdateSettingKey')]; |
|
68 | + abort($error['status'], $error['message']); |
|
69 | + } |
|
70 | + |
|
71 | + public function userIsBlocked() |
|
72 | + { |
|
73 | + $error = ['status' => 403, 'message' => trans('core::errors.userIsBlocked')]; |
|
74 | + abort($error['status'], $error['message']); |
|
75 | + } |
|
76 | + |
|
77 | + public function emailNotConfirmed() |
|
78 | + { |
|
79 | + $error = ['status' => 403, 'message' => trans('core::errors.emailNotConfirmed')]; |
|
80 | + abort($error['status'], $error['message']); |
|
81 | + } |
|
82 | + |
|
83 | + public function emailAlreadyConfirmed() |
|
84 | + { |
|
85 | + $error = ['status' => 403, 'message' => trans('core::errors.emailAlreadyConfirmed')]; |
|
86 | + abort($error['status'], $error['message']); |
|
87 | + } |
|
88 | + |
|
89 | + public function invalidResetToken() |
|
90 | + { |
|
91 | + $error = ['status' => 400, 'message' => trans('core::errors.invalidResetToken')]; |
|
92 | + abort($error['status'], $error['message']); |
|
93 | + } |
|
94 | + |
|
95 | + public function invalidResetPassword() |
|
96 | + { |
|
97 | + $error = ['status' => 400, 'message' => trans('core::errors.invalidResetPassword')]; |
|
98 | + abort($error['status'], $error['message']); |
|
99 | + } |
|
100 | + |
|
101 | + public function invalidOldPassword() |
|
102 | + { |
|
103 | + $error = ['status' => 400, 'message' => trans('core::errors.invalidOldPassword')]; |
|
104 | + abort($error['status'], $error['message']); |
|
105 | + } |
|
106 | + |
|
107 | + public function notFound($text) |
|
108 | + { |
|
109 | + $error = ['status' => 404, 'message' => trans('core::errors.notFound', ['replace' => $text])]; |
|
110 | + abort($error['status'], $error['message']); |
|
111 | + } |
|
112 | + |
|
113 | + public function generalError() |
|
114 | + { |
|
115 | + $error = ['status' => 400, 'message' => trans('core::errors.generalError')]; |
|
116 | + abort($error['status'], $error['message']); |
|
117 | + } |
|
118 | 118 | } |
119 | 119 | \ No newline at end of file |
@@ -6,283 +6,283 @@ |
||
6 | 6 | |
7 | 7 | class BaseApiController extends Controller |
8 | 8 | { |
9 | - /** |
|
10 | - * The config implementation. |
|
11 | - * |
|
12 | - * @var array |
|
13 | - */ |
|
14 | - protected $config; |
|
9 | + /** |
|
10 | + * The config implementation. |
|
11 | + * |
|
12 | + * @var array |
|
13 | + */ |
|
14 | + protected $config; |
|
15 | 15 | |
16 | - /** |
|
17 | - * The relations implementation. |
|
18 | - * |
|
19 | - * @var array |
|
20 | - */ |
|
21 | - protected $relations; |
|
16 | + /** |
|
17 | + * The relations implementation. |
|
18 | + * |
|
19 | + * @var array |
|
20 | + */ |
|
21 | + protected $relations; |
|
22 | 22 | |
23 | - /** |
|
24 | - * The repo implementation. |
|
25 | - * |
|
26 | - * @var object |
|
27 | - */ |
|
28 | - protected $repo; |
|
23 | + /** |
|
24 | + * The repo implementation. |
|
25 | + * |
|
26 | + * @var object |
|
27 | + */ |
|
28 | + protected $repo; |
|
29 | 29 | |
30 | - public function __construct() |
|
31 | - { |
|
32 | - $this->config = \CoreConfig::getConfig(); |
|
33 | - $this->model = property_exists($this, 'model') ? $this->model : false; |
|
34 | - $this->validationRules = property_exists($this, 'validationRules') ? $this->validationRules : false; |
|
35 | - $this->skipPermissionCheck = property_exists($this, 'skipPermissionCheck') ? $this->skipPermissionCheck : []; |
|
36 | - $this->skipLoginCheck = property_exists($this, 'skipLoginCheck') ? $this->skipLoginCheck : []; |
|
37 | - $route = explode('@',\Route::currentRouteAction())[1]; |
|
30 | + public function __construct() |
|
31 | + { |
|
32 | + $this->config = \CoreConfig::getConfig(); |
|
33 | + $this->model = property_exists($this, 'model') ? $this->model : false; |
|
34 | + $this->validationRules = property_exists($this, 'validationRules') ? $this->validationRules : false; |
|
35 | + $this->skipPermissionCheck = property_exists($this, 'skipPermissionCheck') ? $this->skipPermissionCheck : []; |
|
36 | + $this->skipLoginCheck = property_exists($this, 'skipLoginCheck') ? $this->skipLoginCheck : []; |
|
37 | + $route = explode('@',\Route::currentRouteAction())[1]; |
|
38 | 38 | |
39 | - $this->middleware(function ($request, $next) { |
|
39 | + $this->middleware(function ($request, $next) { |
|
40 | 40 | |
41 | - $this->repo = call_user_func_array("\Core::{$this->model}", []); |
|
42 | - return $next($request); |
|
43 | - }); |
|
41 | + $this->repo = call_user_func_array("\Core::{$this->model}", []); |
|
42 | + return $next($request); |
|
43 | + }); |
|
44 | 44 | |
45 | - $this->checkPermission($route); |
|
46 | - $this->setRelations($route); |
|
47 | - $this->setSessions(); |
|
48 | - } |
|
45 | + $this->checkPermission($route); |
|
46 | + $this->setRelations($route); |
|
47 | + $this->setSessions(); |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * Fetch all records with relations from storage. |
|
52 | - * |
|
53 | - * @param string $sortBy The name of the column to sort by. |
|
54 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
55 | - * @return \Illuminate\Http\Response |
|
56 | - */ |
|
57 | - public function index($sortBy = 'created_at', $desc = 1) |
|
58 | - { |
|
59 | - return \Response::json($this->repo->all($this->relations, $sortBy, $desc), 200); |
|
60 | - } |
|
50 | + /** |
|
51 | + * Fetch all records with relations from storage. |
|
52 | + * |
|
53 | + * @param string $sortBy The name of the column to sort by. |
|
54 | + * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
55 | + * @return \Illuminate\Http\Response |
|
56 | + */ |
|
57 | + public function index($sortBy = 'created_at', $desc = 1) |
|
58 | + { |
|
59 | + return \Response::json($this->repo->all($this->relations, $sortBy, $desc), 200); |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * Fetch the single object with relations from storage. |
|
64 | - * |
|
65 | - * @param integer $id Id of the requested model. |
|
66 | - * @return \Illuminate\Http\Response |
|
67 | - */ |
|
68 | - public function find($id) |
|
69 | - { |
|
70 | - return \Response::json($this->repo->find($id, $this->relations), 200); |
|
71 | - } |
|
62 | + /** |
|
63 | + * Fetch the single object with relations from storage. |
|
64 | + * |
|
65 | + * @param integer $id Id of the requested model. |
|
66 | + * @return \Illuminate\Http\Response |
|
67 | + */ |
|
68 | + public function find($id) |
|
69 | + { |
|
70 | + return \Response::json($this->repo->find($id, $this->relations), 200); |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * Paginate all records with relations from storage |
|
75 | - * that matche the given query. |
|
76 | - * |
|
77 | - * @param string $query The search text. |
|
78 | - * @param integer $perPage Number of rows per page default 15. |
|
79 | - * @param string $sortBy The name of the column to sort by. |
|
80 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
81 | - * @return \Illuminate\Http\Response |
|
82 | - */ |
|
83 | - public function search($query = '', $perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
84 | - { |
|
85 | - return \Response::json($this->repo->search($query, $perPage, $this->relations, $sortBy, $desc), 200); |
|
86 | - } |
|
73 | + /** |
|
74 | + * Paginate all records with relations from storage |
|
75 | + * that matche the given query. |
|
76 | + * |
|
77 | + * @param string $query The search text. |
|
78 | + * @param integer $perPage Number of rows per page default 15. |
|
79 | + * @param string $sortBy The name of the column to sort by. |
|
80 | + * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
81 | + * @return \Illuminate\Http\Response |
|
82 | + */ |
|
83 | + public function search($query = '', $perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
84 | + { |
|
85 | + return \Response::json($this->repo->search($query, $perPage, $this->relations, $sortBy, $desc), 200); |
|
86 | + } |
|
87 | 87 | |
88 | - /** |
|
89 | - * Fetch records from the storage based on the given |
|
90 | - * condition. |
|
91 | - * |
|
92 | - * @param \Illuminate\Http\Request $request |
|
93 | - * @param string $sortBy The name of the column to sort by. |
|
94 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
95 | - * @return \Illuminate\Http\Response |
|
96 | - */ |
|
97 | - public function findby(Request $request, $sortBy = 'created_at', $desc = 1) |
|
98 | - { |
|
99 | - return \Response::json($this->repo->findBy($request->all(), $this->relations, $sortBy, $desc), 200); |
|
100 | - } |
|
88 | + /** |
|
89 | + * Fetch records from the storage based on the given |
|
90 | + * condition. |
|
91 | + * |
|
92 | + * @param \Illuminate\Http\Request $request |
|
93 | + * @param string $sortBy The name of the column to sort by. |
|
94 | + * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
95 | + * @return \Illuminate\Http\Response |
|
96 | + */ |
|
97 | + public function findby(Request $request, $sortBy = 'created_at', $desc = 1) |
|
98 | + { |
|
99 | + return \Response::json($this->repo->findBy($request->all(), $this->relations, $sortBy, $desc), 200); |
|
100 | + } |
|
101 | 101 | |
102 | - /** |
|
103 | - * Fetch the first record from the storage based on the given |
|
104 | - * condition. |
|
105 | - * |
|
106 | - * @param \Illuminate\Http\Request $request |
|
107 | - * @return \Illuminate\Http\Response |
|
108 | - */ |
|
109 | - public function first(Request $request) |
|
110 | - { |
|
111 | - return \Response::json($this->repo->first($request->all(), $this->relations), 200); |
|
112 | - } |
|
102 | + /** |
|
103 | + * Fetch the first record from the storage based on the given |
|
104 | + * condition. |
|
105 | + * |
|
106 | + * @param \Illuminate\Http\Request $request |
|
107 | + * @return \Illuminate\Http\Response |
|
108 | + */ |
|
109 | + public function first(Request $request) |
|
110 | + { |
|
111 | + return \Response::json($this->repo->first($request->all(), $this->relations), 200); |
|
112 | + } |
|
113 | 113 | |
114 | - /** |
|
115 | - * Paginate all records with relations from storage. |
|
116 | - * |
|
117 | - * @param integer $perPage Number of rows per page default 15. |
|
118 | - * @param string $sortBy The name of the column to sort by. |
|
119 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
120 | - * @return \Illuminate\Http\Response |
|
121 | - */ |
|
122 | - public function paginate($perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
123 | - { |
|
124 | - return \Response::json($this->repo->paginate($perPage, $this->relations, $sortBy, $desc), 200); |
|
125 | - } |
|
114 | + /** |
|
115 | + * Paginate all records with relations from storage. |
|
116 | + * |
|
117 | + * @param integer $perPage Number of rows per page default 15. |
|
118 | + * @param string $sortBy The name of the column to sort by. |
|
119 | + * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
120 | + * @return \Illuminate\Http\Response |
|
121 | + */ |
|
122 | + public function paginate($perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
123 | + { |
|
124 | + return \Response::json($this->repo->paginate($perPage, $this->relations, $sortBy, $desc), 200); |
|
125 | + } |
|
126 | 126 | |
127 | - /** |
|
128 | - * Fetch all records with relations based on |
|
129 | - * the given condition from storage in pages. |
|
130 | - * |
|
131 | - * @param \Illuminate\Http\Request $request |
|
132 | - * @param integer $perPage Number of rows per page default 15. |
|
133 | - * @param string $sortBy The name of the column to sort by. |
|
134 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
135 | - * @return \Illuminate\Http\Response |
|
136 | - */ |
|
137 | - public function paginateby(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
138 | - { |
|
139 | - return \Response::json($this->repo->paginateBy($request->all(), $perPage, $this->relations, $sortBy, $desc), 200); |
|
140 | - } |
|
127 | + /** |
|
128 | + * Fetch all records with relations based on |
|
129 | + * the given condition from storage in pages. |
|
130 | + * |
|
131 | + * @param \Illuminate\Http\Request $request |
|
132 | + * @param integer $perPage Number of rows per page default 15. |
|
133 | + * @param string $sortBy The name of the column to sort by. |
|
134 | + * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
135 | + * @return \Illuminate\Http\Response |
|
136 | + */ |
|
137 | + public function paginateby(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
138 | + { |
|
139 | + return \Response::json($this->repo->paginateBy($request->all(), $perPage, $this->relations, $sortBy, $desc), 200); |
|
140 | + } |
|
141 | 141 | |
142 | - /** |
|
143 | - * Save the given model to storage. |
|
144 | - * |
|
145 | - * @param \Illuminate\Http\Request $request |
|
146 | - * @return \Illuminate\Http\Response |
|
147 | - */ |
|
148 | - public function save(Request $request) |
|
149 | - { |
|
150 | - foreach ($this->validationRules as &$rule) |
|
151 | - { |
|
152 | - if (strpos($rule, 'exists') && ! strpos($rule, 'deleted_at,NULL')) |
|
153 | - { |
|
154 | - $rule .= ',deleted_at,NULL'; |
|
155 | - } |
|
142 | + /** |
|
143 | + * Save the given model to storage. |
|
144 | + * |
|
145 | + * @param \Illuminate\Http\Request $request |
|
146 | + * @return \Illuminate\Http\Response |
|
147 | + */ |
|
148 | + public function save(Request $request) |
|
149 | + { |
|
150 | + foreach ($this->validationRules as &$rule) |
|
151 | + { |
|
152 | + if (strpos($rule, 'exists') && ! strpos($rule, 'deleted_at,NULL')) |
|
153 | + { |
|
154 | + $rule .= ',deleted_at,NULL'; |
|
155 | + } |
|
156 | 156 | |
157 | - if ($request->has('id')) |
|
158 | - { |
|
159 | - $rule = str_replace('{id}', $request->get('id'), $rule); |
|
160 | - } |
|
161 | - else |
|
162 | - { |
|
163 | - $rule = str_replace(',{id}', '', $rule); |
|
164 | - } |
|
165 | - } |
|
157 | + if ($request->has('id')) |
|
158 | + { |
|
159 | + $rule = str_replace('{id}', $request->get('id'), $rule); |
|
160 | + } |
|
161 | + else |
|
162 | + { |
|
163 | + $rule = str_replace(',{id}', '', $rule); |
|
164 | + } |
|
165 | + } |
|
166 | 166 | |
167 | - $this->validate($request, $this->validationRules); |
|
167 | + $this->validate($request, $this->validationRules); |
|
168 | 168 | |
169 | - return \Response::json($this->repo->save($request->all()), 200); |
|
170 | - } |
|
169 | + return \Response::json($this->repo->save($request->all()), 200); |
|
170 | + } |
|
171 | 171 | |
172 | - /** |
|
173 | - * Delete by the given id from storage. |
|
174 | - * |
|
175 | - * @param integer $id Id of the deleted model. |
|
176 | - * @return \Illuminate\Http\Response |
|
177 | - */ |
|
178 | - public function delete($id) |
|
179 | - { |
|
180 | - return \Response::json($this->repo->delete($id), 200); |
|
181 | - } |
|
172 | + /** |
|
173 | + * Delete by the given id from storage. |
|
174 | + * |
|
175 | + * @param integer $id Id of the deleted model. |
|
176 | + * @return \Illuminate\Http\Response |
|
177 | + */ |
|
178 | + public function delete($id) |
|
179 | + { |
|
180 | + return \Response::json($this->repo->delete($id), 200); |
|
181 | + } |
|
182 | 182 | |
183 | - /** |
|
184 | - * Return the deleted models in pages based on the given conditions. |
|
185 | - * |
|
186 | - * @param \Illuminate\Http\Request $request |
|
187 | - * @param integer $perPage Number of rows per page default 15. |
|
188 | - * @param string $sortBy The name of the column to sort by. |
|
189 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
190 | - * @return \Illuminate\Http\Response |
|
191 | - */ |
|
192 | - public function deleted(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
193 | - { |
|
194 | - return \Response::json($this->repo->deleted($request->all(), $perPage, $sortBy, $desc), 200); |
|
195 | - } |
|
183 | + /** |
|
184 | + * Return the deleted models in pages based on the given conditions. |
|
185 | + * |
|
186 | + * @param \Illuminate\Http\Request $request |
|
187 | + * @param integer $perPage Number of rows per page default 15. |
|
188 | + * @param string $sortBy The name of the column to sort by. |
|
189 | + * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
190 | + * @return \Illuminate\Http\Response |
|
191 | + */ |
|
192 | + public function deleted(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
193 | + { |
|
194 | + return \Response::json($this->repo->deleted($request->all(), $perPage, $sortBy, $desc), 200); |
|
195 | + } |
|
196 | 196 | |
197 | - /** |
|
198 | - * Restore the deleted model. |
|
199 | - * |
|
200 | - * @param integer $id Id of the restored model. |
|
201 | - * @return \Illuminate\Http\Response |
|
202 | - */ |
|
203 | - public function restore($id) |
|
204 | - { |
|
205 | - return \Response::json($this->repo->restore($id), 200); |
|
206 | - } |
|
197 | + /** |
|
198 | + * Restore the deleted model. |
|
199 | + * |
|
200 | + * @param integer $id Id of the restored model. |
|
201 | + * @return \Illuminate\Http\Response |
|
202 | + */ |
|
203 | + public function restore($id) |
|
204 | + { |
|
205 | + return \Response::json($this->repo->restore($id), 200); |
|
206 | + } |
|
207 | 207 | |
208 | - /** |
|
209 | - * Check if the logged in user can do the given permission. |
|
210 | - * |
|
211 | - * @param string $permission |
|
212 | - * @return void |
|
213 | - */ |
|
214 | - private function checkPermission($permission) |
|
215 | - { |
|
216 | - \Auth::shouldUse('api'); |
|
217 | - $this->middleware('auth:api', ['except' => $this->skipLoginCheck]); |
|
208 | + /** |
|
209 | + * Check if the logged in user can do the given permission. |
|
210 | + * |
|
211 | + * @param string $permission |
|
212 | + * @return void |
|
213 | + */ |
|
214 | + private function checkPermission($permission) |
|
215 | + { |
|
216 | + \Auth::shouldUse('api'); |
|
217 | + $this->middleware('auth:api', ['except' => $this->skipLoginCheck]); |
|
218 | 218 | |
219 | - if ( ! in_array($permission, $this->skipLoginCheck) && $user = \Auth::user()) |
|
220 | - { |
|
221 | - $user = \Auth::user(); |
|
222 | - $permission = $permission !== 'index' ? $permission : 'list'; |
|
223 | - $isPasswordClient = $user->token()->client->password_client; |
|
219 | + if ( ! in_array($permission, $this->skipLoginCheck) && $user = \Auth::user()) |
|
220 | + { |
|
221 | + $user = \Auth::user(); |
|
222 | + $permission = $permission !== 'index' ? $permission : 'list'; |
|
223 | + $isPasswordClient = $user->token()->client->password_client; |
|
224 | 224 | |
225 | - if ($user->blocked) |
|
226 | - { |
|
227 | - \ErrorHandler::userIsBlocked(); |
|
228 | - } |
|
225 | + if ($user->blocked) |
|
226 | + { |
|
227 | + \ErrorHandler::userIsBlocked(); |
|
228 | + } |
|
229 | 229 | |
230 | - if ($isPasswordClient && (in_array($permission, $this->skipPermissionCheck) || \Core::users()->can($permission, $this->model))) |
|
231 | - {} |
|
232 | - elseif ( ! $isPasswordClient && $user->tokenCan($this->model . '-' . $permission)) |
|
233 | - {} |
|
234 | - else |
|
235 | - { |
|
230 | + if ($isPasswordClient && (in_array($permission, $this->skipPermissionCheck) || \Core::users()->can($permission, $this->model))) |
|
231 | + {} |
|
232 | + elseif ( ! $isPasswordClient && $user->tokenCan($this->model . '-' . $permission)) |
|
233 | + {} |
|
234 | + else |
|
235 | + { |
|
236 | 236 | |
237 | - \ErrorHandler::noPermissions(); |
|
238 | - } |
|
239 | - } |
|
240 | - } |
|
237 | + \ErrorHandler::noPermissions(); |
|
238 | + } |
|
239 | + } |
|
240 | + } |
|
241 | 241 | |
242 | - /** |
|
243 | - * Set sessions based on the given headers in the request. |
|
244 | - * |
|
245 | - * @return void |
|
246 | - */ |
|
247 | - private function setSessions() |
|
248 | - { |
|
249 | - \Session::put('time-zone', \Request::header('time-zone') ?: 0); |
|
242 | + /** |
|
243 | + * Set sessions based on the given headers in the request. |
|
244 | + * |
|
245 | + * @return void |
|
246 | + */ |
|
247 | + private function setSessions() |
|
248 | + { |
|
249 | + \Session::put('time-zone', \Request::header('time-zone') ?: 0); |
|
250 | 250 | |
251 | - $locale = \Request::header('locale'); |
|
252 | - switch ($locale) |
|
253 | - { |
|
254 | - case 'en': |
|
255 | - \App::setLocale('en'); |
|
256 | - \Session::put('locale', 'en'); |
|
257 | - break; |
|
251 | + $locale = \Request::header('locale'); |
|
252 | + switch ($locale) |
|
253 | + { |
|
254 | + case 'en': |
|
255 | + \App::setLocale('en'); |
|
256 | + \Session::put('locale', 'en'); |
|
257 | + break; |
|
258 | 258 | |
259 | - case 'ar': |
|
260 | - \App::setLocale('ar'); |
|
261 | - \Session::put('locale', 'ar'); |
|
262 | - break; |
|
259 | + case 'ar': |
|
260 | + \App::setLocale('ar'); |
|
261 | + \Session::put('locale', 'ar'); |
|
262 | + break; |
|
263 | 263 | |
264 | - case 'all': |
|
265 | - \App::setLocale('en'); |
|
266 | - \Session::put('locale', 'all'); |
|
267 | - break; |
|
264 | + case 'all': |
|
265 | + \App::setLocale('en'); |
|
266 | + \Session::put('locale', 'all'); |
|
267 | + break; |
|
268 | 268 | |
269 | - default: |
|
270 | - \App::setLocale('en'); |
|
271 | - \Session::put('locale', 'en'); |
|
272 | - break; |
|
273 | - } |
|
274 | - } |
|
269 | + default: |
|
270 | + \App::setLocale('en'); |
|
271 | + \Session::put('locale', 'en'); |
|
272 | + break; |
|
273 | + } |
|
274 | + } |
|
275 | 275 | |
276 | - /** |
|
277 | - * Set relation based on the called api. |
|
278 | - * |
|
279 | - * @param string $route |
|
280 | - * @return void |
|
281 | - */ |
|
282 | - private function setRelations($route) |
|
283 | - { |
|
284 | - $route = $route !== 'index' ? $route : 'list'; |
|
285 | - $relations = array_key_exists($this->model, $this->config['relations']) ? $this->config['relations'][$this->model] : false; |
|
286 | - $this->relations = $relations && isset($relations[$route]) ? $relations[$route] : []; |
|
287 | - } |
|
276 | + /** |
|
277 | + * Set relation based on the called api. |
|
278 | + * |
|
279 | + * @param string $route |
|
280 | + * @return void |
|
281 | + */ |
|
282 | + private function setRelations($route) |
|
283 | + { |
|
284 | + $route = $route !== 'index' ? $route : 'list'; |
|
285 | + $relations = array_key_exists($this->model, $this->config['relations']) ? $this->config['relations'][$this->model] : false; |
|
286 | + $this->relations = $relations && isset($relations[$route]) ? $relations[$route] : []; |
|
287 | + } |
|
288 | 288 | } |
@@ -5,63 +5,63 @@ |
||
5 | 5 | */ |
6 | 6 | class AclUserObserver { |
7 | 7 | |
8 | - public function saving($model) |
|
9 | - { |
|
10 | - // |
|
11 | - } |
|
8 | + public function saving($model) |
|
9 | + { |
|
10 | + // |
|
11 | + } |
|
12 | 12 | |
13 | - public function saved($model) |
|
14 | - { |
|
15 | - // |
|
16 | - } |
|
13 | + public function saved($model) |
|
14 | + { |
|
15 | + // |
|
16 | + } |
|
17 | 17 | |
18 | - public function creating($model) |
|
19 | - { |
|
20 | - // |
|
21 | - } |
|
18 | + public function creating($model) |
|
19 | + { |
|
20 | + // |
|
21 | + } |
|
22 | 22 | |
23 | - public function created($model) |
|
24 | - { |
|
25 | - // |
|
26 | - } |
|
23 | + public function created($model) |
|
24 | + { |
|
25 | + // |
|
26 | + } |
|
27 | 27 | |
28 | - public function updating($model) |
|
29 | - { |
|
30 | - // |
|
31 | - } |
|
28 | + public function updating($model) |
|
29 | + { |
|
30 | + // |
|
31 | + } |
|
32 | 32 | |
33 | - public function updated($model) |
|
34 | - { |
|
35 | - if ($model->isDirty('blocked') && $model->blocked) |
|
36 | - { |
|
37 | - $model->tokens()->each(function($token){ |
|
33 | + public function updated($model) |
|
34 | + { |
|
35 | + if ($model->isDirty('blocked') && $model->blocked) |
|
36 | + { |
|
37 | + $model->tokens()->each(function($token){ |
|
38 | 38 | |
39 | - \Core::users()->revokeAccessToken($token); |
|
39 | + \Core::users()->revokeAccessToken($token); |
|
40 | 40 | |
41 | - }); |
|
42 | - } |
|
43 | - } |
|
41 | + }); |
|
42 | + } |
|
43 | + } |
|
44 | 44 | |
45 | - public function deleting($model) |
|
46 | - { |
|
47 | - if ($model->getOriginal('id') == \Auth::id()) |
|
48 | - { |
|
49 | - \ErrorHandler::noPermissions(); |
|
50 | - } |
|
51 | - } |
|
45 | + public function deleting($model) |
|
46 | + { |
|
47 | + if ($model->getOriginal('id') == \Auth::id()) |
|
48 | + { |
|
49 | + \ErrorHandler::noPermissions(); |
|
50 | + } |
|
51 | + } |
|
52 | 52 | |
53 | - public function deleted($model) |
|
54 | - { |
|
55 | - // |
|
56 | - } |
|
53 | + public function deleted($model) |
|
54 | + { |
|
55 | + // |
|
56 | + } |
|
57 | 57 | |
58 | - public function restoring($model) |
|
59 | - { |
|
60 | - // |
|
61 | - } |
|
58 | + public function restoring($model) |
|
59 | + { |
|
60 | + // |
|
61 | + } |
|
62 | 62 | |
63 | - public function restored($model) |
|
64 | - { |
|
65 | - // |
|
66 | - } |
|
63 | + public function restored($model) |
|
64 | + { |
|
65 | + // |
|
66 | + } |
|
67 | 67 | } |
68 | 68 | \ No newline at end of file |
@@ -5,95 +5,95 @@ |
||
5 | 5 | |
6 | 6 | class LoginProxy |
7 | 7 | { |
8 | - private $apiConsumer; |
|
9 | - |
|
10 | - private $auth; |
|
11 | - |
|
12 | - private $request; |
|
13 | - |
|
14 | - private $userRepository; |
|
15 | - |
|
16 | - public function __construct(Application $app) |
|
17 | - { |
|
18 | - |
|
19 | - $this->userRepository = $app->make('App\Modules\Acl\Repositories\UserRepository'); |
|
20 | - $this->apiConsumer = $app->make('apiconsumer'); |
|
21 | - $this->auth = $app->make('auth'); |
|
22 | - $this->request = $app->make('request'); |
|
23 | - } |
|
24 | - |
|
25 | - /** |
|
26 | - * Attempt to create an access token using user credentials. |
|
27 | - * |
|
28 | - * @param array $credentials |
|
29 | - * @param boolean $adminLogin |
|
30 | - * @return array |
|
31 | - */ |
|
32 | - public function login($credentials, $adminLogin = false) |
|
33 | - { |
|
34 | - $this->userRepository->login($credentials, $adminLogin); |
|
35 | - |
|
36 | - return $this->proxy('password', [ |
|
37 | - 'username' => $credentials['email'], |
|
38 | - 'password' => $credentials['password'] |
|
39 | - ]); |
|
40 | - } |
|
41 | - |
|
42 | - /** |
|
43 | - * Attempt to refresh the access token useing the given refresh token. |
|
44 | - * |
|
45 | - * @param string $refreshToken |
|
46 | - * @return array |
|
47 | - */ |
|
48 | - public function refreshtoken($refreshToken) |
|
49 | - { |
|
50 | - return $this->proxy('refresh_token', [ |
|
51 | - 'refresh_token' => $refreshToken |
|
52 | - ]); |
|
53 | - } |
|
54 | - |
|
55 | - /** |
|
56 | - * Proxy a request to the OAuth server. |
|
57 | - * |
|
58 | - * @param string $grantType what type of grant type should be proxied |
|
59 | - * @param array |
|
60 | - */ |
|
61 | - public function proxy($grantType, array $data = []) |
|
62 | - { |
|
63 | - $data = array_merge($data, [ |
|
64 | - 'client_id' => config('skeleton.passport_client_id'), |
|
65 | - 'client_secret' => config('skeleton.passport_client_secret'), |
|
66 | - 'grant_type' => $grantType |
|
67 | - ]); |
|
68 | - |
|
69 | - $response = $this->apiConsumer->post('/oauth/token', $data); |
|
70 | - |
|
71 | - if ( ! $response->isSuccessful()) |
|
72 | - { |
|
73 | - if ($grantType == 'refresh_token') |
|
74 | - { |
|
75 | - \ErrorHandler::invalidRefreshToken(); |
|
76 | - } |
|
77 | - |
|
78 | - \ErrorHandler::loginFailed(); |
|
79 | - } |
|
80 | - |
|
81 | - $data = json_decode($response->getContent()); |
|
82 | - |
|
83 | - return [ |
|
84 | - 'access_token' => $data->access_token, |
|
85 | - 'refresh_token' => $data->refresh_token, |
|
86 | - 'expires_in' => $data->expires_in |
|
87 | - ]; |
|
88 | - } |
|
89 | - |
|
90 | - /** |
|
91 | - * Logs out the user. We revoke access token and refresh token. |
|
92 | - * |
|
93 | - * @return void |
|
94 | - */ |
|
95 | - public function logout() |
|
96 | - { |
|
97 | - \Core::users()->revokeAccessToken($this->auth->user()->token()); |
|
98 | - } |
|
8 | + private $apiConsumer; |
|
9 | + |
|
10 | + private $auth; |
|
11 | + |
|
12 | + private $request; |
|
13 | + |
|
14 | + private $userRepository; |
|
15 | + |
|
16 | + public function __construct(Application $app) |
|
17 | + { |
|
18 | + |
|
19 | + $this->userRepository = $app->make('App\Modules\Acl\Repositories\UserRepository'); |
|
20 | + $this->apiConsumer = $app->make('apiconsumer'); |
|
21 | + $this->auth = $app->make('auth'); |
|
22 | + $this->request = $app->make('request'); |
|
23 | + } |
|
24 | + |
|
25 | + /** |
|
26 | + * Attempt to create an access token using user credentials. |
|
27 | + * |
|
28 | + * @param array $credentials |
|
29 | + * @param boolean $adminLogin |
|
30 | + * @return array |
|
31 | + */ |
|
32 | + public function login($credentials, $adminLogin = false) |
|
33 | + { |
|
34 | + $this->userRepository->login($credentials, $adminLogin); |
|
35 | + |
|
36 | + return $this->proxy('password', [ |
|
37 | + 'username' => $credentials['email'], |
|
38 | + 'password' => $credentials['password'] |
|
39 | + ]); |
|
40 | + } |
|
41 | + |
|
42 | + /** |
|
43 | + * Attempt to refresh the access token useing the given refresh token. |
|
44 | + * |
|
45 | + * @param string $refreshToken |
|
46 | + * @return array |
|
47 | + */ |
|
48 | + public function refreshtoken($refreshToken) |
|
49 | + { |
|
50 | + return $this->proxy('refresh_token', [ |
|
51 | + 'refresh_token' => $refreshToken |
|
52 | + ]); |
|
53 | + } |
|
54 | + |
|
55 | + /** |
|
56 | + * Proxy a request to the OAuth server. |
|
57 | + * |
|
58 | + * @param string $grantType what type of grant type should be proxied |
|
59 | + * @param array |
|
60 | + */ |
|
61 | + public function proxy($grantType, array $data = []) |
|
62 | + { |
|
63 | + $data = array_merge($data, [ |
|
64 | + 'client_id' => config('skeleton.passport_client_id'), |
|
65 | + 'client_secret' => config('skeleton.passport_client_secret'), |
|
66 | + 'grant_type' => $grantType |
|
67 | + ]); |
|
68 | + |
|
69 | + $response = $this->apiConsumer->post('/oauth/token', $data); |
|
70 | + |
|
71 | + if ( ! $response->isSuccessful()) |
|
72 | + { |
|
73 | + if ($grantType == 'refresh_token') |
|
74 | + { |
|
75 | + \ErrorHandler::invalidRefreshToken(); |
|
76 | + } |
|
77 | + |
|
78 | + \ErrorHandler::loginFailed(); |
|
79 | + } |
|
80 | + |
|
81 | + $data = json_decode($response->getContent()); |
|
82 | + |
|
83 | + return [ |
|
84 | + 'access_token' => $data->access_token, |
|
85 | + 'refresh_token' => $data->refresh_token, |
|
86 | + 'expires_in' => $data->expires_in |
|
87 | + ]; |
|
88 | + } |
|
89 | + |
|
90 | + /** |
|
91 | + * Logs out the user. We revoke access token and refresh token. |
|
92 | + * |
|
93 | + * @return void |
|
94 | + */ |
|
95 | + public function logout() |
|
96 | + { |
|
97 | + \Core::users()->revokeAccessToken($this->auth->user()->token()); |
|
98 | + } |
|
99 | 99 | } |
100 | 100 | \ No newline at end of file |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /* |
|
5 | + /* |
|
6 | 6 | |-------------------------------------------------------------------------- |
7 | 7 | | Disable Confirm Email |
8 | 8 | |-------------------------------------------------------------------------- |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | | |
12 | 12 | */ |
13 | 13 | |
14 | - 'disable_confirm_email' => env('DISABLE_CONFIRM_EMAIL', false), |
|
14 | + 'disable_confirm_email' => env('DISABLE_CONFIRM_EMAIL', false), |
|
15 | 15 | |
16 | - /* |
|
16 | + /* |
|
17 | 17 | |-------------------------------------------------------------------------- |
18 | 18 | | Confirm Email URL |
19 | 19 | |-------------------------------------------------------------------------- |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | | |
23 | 23 | */ |
24 | 24 | |
25 | - 'confrim_email_url' => env('CONFIRM_EMAIL_URL'), |
|
25 | + 'confrim_email_url' => env('CONFIRM_EMAIL_URL'), |
|
26 | 26 | |
27 | - /* |
|
27 | + /* |
|
28 | 28 | |-------------------------------------------------------------------------- |
29 | 29 | | Reset Password URL |
30 | 30 | |-------------------------------------------------------------------------- |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | | |
34 | 34 | */ |
35 | 35 | |
36 | - 'reset_password_url' => env('RESET_PASSWORD_URL'), |
|
36 | + 'reset_password_url' => env('RESET_PASSWORD_URL'), |
|
37 | 37 | |
38 | - /* |
|
38 | + /* |
|
39 | 39 | |-------------------------------------------------------------------------- |
40 | 40 | | Passport Client Id |
41 | 41 | |-------------------------------------------------------------------------- |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | | |
45 | 45 | */ |
46 | 46 | |
47 | - 'passport_client_id' => env('PASSWORD_CLIENT_ID'), |
|
47 | + 'passport_client_id' => env('PASSWORD_CLIENT_ID'), |
|
48 | 48 | |
49 | - /* |
|
49 | + /* |
|
50 | 50 | |-------------------------------------------------------------------------- |
51 | 51 | | Passport Client Secret |
52 | 52 | |-------------------------------------------------------------------------- |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | | |
56 | 56 | */ |
57 | 57 | |
58 | - 'passport_client_secret' => env('PASSWORD_CLIENT_SECRET'), |
|
58 | + 'passport_client_secret' => env('PASSWORD_CLIENT_SECRET'), |
|
59 | 59 | |
60 | - /* |
|
60 | + /* |
|
61 | 61 | |-------------------------------------------------------------------------- |
62 | 62 | | Social Pass |
63 | 63 | |-------------------------------------------------------------------------- |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | | |
67 | 67 | */ |
68 | 68 | |
69 | - 'social_pass' => env('SOCIAL_PASS', false), |
|
69 | + 'social_pass' => env('SOCIAL_PASS', false), |
|
70 | 70 | |
71 | - /* |
|
71 | + /* |
|
72 | 72 | |-------------------------------------------------------------------------- |
73 | 73 | | Relations Between Models |
74 | 74 | |-------------------------------------------------------------------------- |
@@ -77,88 +77,88 @@ discard block |
||
77 | 77 | | |
78 | 78 | */ |
79 | 79 | |
80 | - 'relations' => [ |
|
81 | - 'users' => [ |
|
82 | - 'list' => [], |
|
83 | - 'find' => [], |
|
84 | - 'findby' => [], |
|
85 | - 'paginate' => [], |
|
86 | - 'paginateby' => [], |
|
87 | - 'first' => [], |
|
88 | - 'search' => [], |
|
89 | - 'account' => [], |
|
90 | - 'group' => [], |
|
91 | - 'deleted' => [], |
|
92 | - ], |
|
93 | - 'permissions' => [ |
|
94 | - 'list' => [], |
|
95 | - 'find' => [], |
|
96 | - 'findby' => [], |
|
97 | - 'paginate' => [], |
|
98 | - 'paginateby' => [], |
|
99 | - 'first' => [], |
|
100 | - 'search' => [], |
|
101 | - 'deleted' => [], |
|
102 | - ], |
|
103 | - 'groups' => [ |
|
104 | - 'list' => [], |
|
105 | - 'find' => [], |
|
106 | - 'findby' => [], |
|
107 | - 'paginate' => [], |
|
108 | - 'paginateby' => [], |
|
109 | - 'first' => [], |
|
110 | - 'search' => [], |
|
111 | - 'deleted' => [], |
|
112 | - ], |
|
113 | - 'oauthClients' => [ |
|
114 | - 'list' => [], |
|
115 | - 'find' => [], |
|
116 | - 'findby' => [], |
|
117 | - 'paginate' => [], |
|
118 | - 'paginateby' => [], |
|
119 | - 'first' => [], |
|
120 | - 'search' => [], |
|
121 | - 'account' => [], |
|
122 | - 'group' => [], |
|
123 | - 'deleted' => [], |
|
124 | - ], |
|
125 | - 'notifications' => [ |
|
126 | - 'list' => [], |
|
127 | - 'unread' => [], |
|
128 | - ], |
|
129 | - 'pushNotificationDevices' => [ |
|
130 | - 'list' => [], |
|
131 | - 'find' => [], |
|
132 | - 'findby' => [], |
|
133 | - 'paginate' => [], |
|
134 | - 'paginateby' => [], |
|
135 | - 'first' => [], |
|
136 | - 'search' => [], |
|
137 | - 'deleted' => [], |
|
138 | - ], |
|
139 | - 'reports' => [ |
|
140 | - 'list' => [], |
|
141 | - 'find' => [], |
|
142 | - 'findby' => [], |
|
143 | - 'paginate' => [], |
|
144 | - 'paginateby' => [], |
|
145 | - 'first' => [], |
|
146 | - 'search' => [], |
|
147 | - 'deleted' => [], |
|
148 | - ], |
|
149 | - 'settings' => [ |
|
150 | - 'list' => [], |
|
151 | - 'find' => [], |
|
152 | - 'findby' => [], |
|
153 | - 'paginate' => [], |
|
154 | - 'paginateby' => [], |
|
155 | - 'first' => [], |
|
156 | - 'search' => [], |
|
157 | - 'deleted' => [], |
|
158 | - ] |
|
159 | - ], |
|
80 | + 'relations' => [ |
|
81 | + 'users' => [ |
|
82 | + 'list' => [], |
|
83 | + 'find' => [], |
|
84 | + 'findby' => [], |
|
85 | + 'paginate' => [], |
|
86 | + 'paginateby' => [], |
|
87 | + 'first' => [], |
|
88 | + 'search' => [], |
|
89 | + 'account' => [], |
|
90 | + 'group' => [], |
|
91 | + 'deleted' => [], |
|
92 | + ], |
|
93 | + 'permissions' => [ |
|
94 | + 'list' => [], |
|
95 | + 'find' => [], |
|
96 | + 'findby' => [], |
|
97 | + 'paginate' => [], |
|
98 | + 'paginateby' => [], |
|
99 | + 'first' => [], |
|
100 | + 'search' => [], |
|
101 | + 'deleted' => [], |
|
102 | + ], |
|
103 | + 'groups' => [ |
|
104 | + 'list' => [], |
|
105 | + 'find' => [], |
|
106 | + 'findby' => [], |
|
107 | + 'paginate' => [], |
|
108 | + 'paginateby' => [], |
|
109 | + 'first' => [], |
|
110 | + 'search' => [], |
|
111 | + 'deleted' => [], |
|
112 | + ], |
|
113 | + 'oauthClients' => [ |
|
114 | + 'list' => [], |
|
115 | + 'find' => [], |
|
116 | + 'findby' => [], |
|
117 | + 'paginate' => [], |
|
118 | + 'paginateby' => [], |
|
119 | + 'first' => [], |
|
120 | + 'search' => [], |
|
121 | + 'account' => [], |
|
122 | + 'group' => [], |
|
123 | + 'deleted' => [], |
|
124 | + ], |
|
125 | + 'notifications' => [ |
|
126 | + 'list' => [], |
|
127 | + 'unread' => [], |
|
128 | + ], |
|
129 | + 'pushNotificationDevices' => [ |
|
130 | + 'list' => [], |
|
131 | + 'find' => [], |
|
132 | + 'findby' => [], |
|
133 | + 'paginate' => [], |
|
134 | + 'paginateby' => [], |
|
135 | + 'first' => [], |
|
136 | + 'search' => [], |
|
137 | + 'deleted' => [], |
|
138 | + ], |
|
139 | + 'reports' => [ |
|
140 | + 'list' => [], |
|
141 | + 'find' => [], |
|
142 | + 'findby' => [], |
|
143 | + 'paginate' => [], |
|
144 | + 'paginateby' => [], |
|
145 | + 'first' => [], |
|
146 | + 'search' => [], |
|
147 | + 'deleted' => [], |
|
148 | + ], |
|
149 | + 'settings' => [ |
|
150 | + 'list' => [], |
|
151 | + 'find' => [], |
|
152 | + 'findby' => [], |
|
153 | + 'paginate' => [], |
|
154 | + 'paginateby' => [], |
|
155 | + 'first' => [], |
|
156 | + 'search' => [], |
|
157 | + 'deleted' => [], |
|
158 | + ] |
|
159 | + ], |
|
160 | 160 | |
161 | - /* |
|
161 | + /* |
|
162 | 162 | |-------------------------------------------------------------------------- |
163 | 163 | | Cache Configurations |
164 | 164 | |-------------------------------------------------------------------------- |
@@ -167,46 +167,46 @@ discard block |
||
167 | 167 | | |
168 | 168 | */ |
169 | 169 | |
170 | - 'cache_config' => [ |
|
171 | - 'oauthClients' => [ |
|
172 | - 'cache' => [ |
|
173 | - 'all', |
|
174 | - 'find', |
|
175 | - 'findBy', |
|
176 | - 'paginate', |
|
177 | - 'paginateBy', |
|
178 | - 'first', |
|
179 | - 'search', |
|
180 | - 'deleted' |
|
181 | - ], |
|
182 | - 'clear' => [ |
|
183 | - 'update' => ['oauthClients', 'users', 'groups'], |
|
184 | - 'save' => ['oauthClients', 'users', 'groups'], |
|
185 | - 'delete' => ['oauthClients', 'users', 'groups'], |
|
186 | - 'restore' => ['oauthClients', 'users', 'groups'], |
|
187 | - 'revoke' => ['oauthClients', 'users', 'groups'], |
|
188 | - 'ubRevoke' => ['oauthClients', 'users', 'groups'], |
|
189 | - 'regenerateSecret' => ['oauthClients', 'users', 'groups'], |
|
190 | - ], |
|
191 | - ], |
|
192 | - 'settings' => [ |
|
193 | - 'cache' => [ |
|
194 | - 'all', |
|
195 | - 'find', |
|
196 | - 'findBy', |
|
197 | - 'paginate', |
|
198 | - 'paginateBy', |
|
199 | - 'first', |
|
200 | - 'search', |
|
201 | - 'deleted' |
|
202 | - ], |
|
203 | - 'clear' => [ |
|
204 | - 'update' => ['settings'], |
|
205 | - 'save' => ['settings'], |
|
206 | - 'delete' => ['settings'], |
|
207 | - 'restore' => ['settings'], |
|
208 | - 'saveMany' => ['settings'], |
|
209 | - ] |
|
210 | - ] |
|
211 | - ] |
|
170 | + 'cache_config' => [ |
|
171 | + 'oauthClients' => [ |
|
172 | + 'cache' => [ |
|
173 | + 'all', |
|
174 | + 'find', |
|
175 | + 'findBy', |
|
176 | + 'paginate', |
|
177 | + 'paginateBy', |
|
178 | + 'first', |
|
179 | + 'search', |
|
180 | + 'deleted' |
|
181 | + ], |
|
182 | + 'clear' => [ |
|
183 | + 'update' => ['oauthClients', 'users', 'groups'], |
|
184 | + 'save' => ['oauthClients', 'users', 'groups'], |
|
185 | + 'delete' => ['oauthClients', 'users', 'groups'], |
|
186 | + 'restore' => ['oauthClients', 'users', 'groups'], |
|
187 | + 'revoke' => ['oauthClients', 'users', 'groups'], |
|
188 | + 'ubRevoke' => ['oauthClients', 'users', 'groups'], |
|
189 | + 'regenerateSecret' => ['oauthClients', 'users', 'groups'], |
|
190 | + ], |
|
191 | + ], |
|
192 | + 'settings' => [ |
|
193 | + 'cache' => [ |
|
194 | + 'all', |
|
195 | + 'find', |
|
196 | + 'findBy', |
|
197 | + 'paginate', |
|
198 | + 'paginateBy', |
|
199 | + 'first', |
|
200 | + 'search', |
|
201 | + 'deleted' |
|
202 | + ], |
|
203 | + 'clear' => [ |
|
204 | + 'update' => ['settings'], |
|
205 | + 'save' => ['settings'], |
|
206 | + 'delete' => ['settings'], |
|
207 | + 'restore' => ['settings'], |
|
208 | + 'saveMany' => ['settings'], |
|
209 | + ] |
|
210 | + ] |
|
211 | + ] |
|
212 | 212 | ]; |
@@ -10,41 +10,41 @@ |
||
10 | 10 | |
11 | 11 | class ResetPassword extends Notification implements ShouldQueue |
12 | 12 | { |
13 | - use Queueable; |
|
13 | + use Queueable; |
|
14 | 14 | |
15 | - protected $token; |
|
15 | + protected $token; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Create a new notification instance. |
|
19 | - */ |
|
20 | - public function __construct($token) |
|
21 | - { |
|
22 | - $this->token = $token; |
|
23 | - } |
|
17 | + /** |
|
18 | + * Create a new notification instance. |
|
19 | + */ |
|
20 | + public function __construct($token) |
|
21 | + { |
|
22 | + $this->token = $token; |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * Get the notification's delivery channels. |
|
27 | - * |
|
28 | - * @param mixed $notifiable |
|
29 | - * @return array |
|
30 | - */ |
|
31 | - public function via($notifiable) |
|
32 | - { |
|
33 | - return ['mail']; |
|
34 | - } |
|
25 | + /** |
|
26 | + * Get the notification's delivery channels. |
|
27 | + * |
|
28 | + * @param mixed $notifiable |
|
29 | + * @return array |
|
30 | + */ |
|
31 | + public function via($notifiable) |
|
32 | + { |
|
33 | + return ['mail']; |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Get the mail representation of the notification. |
|
38 | - * |
|
39 | - * @param mixed $notifiable |
|
40 | - * @return \Illuminate\Notifications\Messages\MailMessage |
|
41 | - */ |
|
42 | - public function toMail($notifiable) |
|
43 | - { |
|
44 | - return (new MailMessage) |
|
45 | - ->subject('Reset passowrd') |
|
46 | - ->line('Reset passowrd') |
|
47 | - ->line('To reset your password click on the button below') |
|
48 | - ->action('Reset password', config('skeleton.reset_password_url') . '/' . $this->token); |
|
49 | - } |
|
36 | + /** |
|
37 | + * Get the mail representation of the notification. |
|
38 | + * |
|
39 | + * @param mixed $notifiable |
|
40 | + * @return \Illuminate\Notifications\Messages\MailMessage |
|
41 | + */ |
|
42 | + public function toMail($notifiable) |
|
43 | + { |
|
44 | + return (new MailMessage) |
|
45 | + ->subject('Reset passowrd') |
|
46 | + ->line('Reset passowrd') |
|
47 | + ->line('To reset your password click on the button below') |
|
48 | + ->action('Reset password', config('skeleton.reset_password_url') . '/' . $this->token); |
|
49 | + } |
|
50 | 50 | } |
51 | 51 | \ No newline at end of file |
@@ -10,39 +10,39 @@ |
||
10 | 10 | |
11 | 11 | class ConfirmEmail extends Notification implements ShouldQueue |
12 | 12 | { |
13 | - use Queueable; |
|
13 | + use Queueable; |
|
14 | 14 | |
15 | - /** |
|
16 | - * Create a new notification instance. |
|
17 | - */ |
|
18 | - public function __construct() |
|
19 | - { |
|
20 | - // |
|
21 | - } |
|
15 | + /** |
|
16 | + * Create a new notification instance. |
|
17 | + */ |
|
18 | + public function __construct() |
|
19 | + { |
|
20 | + // |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Get the notification's delivery channels. |
|
25 | - * |
|
26 | - * @param mixed $notifiable |
|
27 | - * @return array |
|
28 | - */ |
|
29 | - public function via($notifiable) |
|
30 | - { |
|
31 | - return ['mail']; |
|
32 | - } |
|
23 | + /** |
|
24 | + * Get the notification's delivery channels. |
|
25 | + * |
|
26 | + * @param mixed $notifiable |
|
27 | + * @return array |
|
28 | + */ |
|
29 | + public function via($notifiable) |
|
30 | + { |
|
31 | + return ['mail']; |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Get the mail representation of the notification. |
|
36 | - * |
|
37 | - * @param mixed $notifiable |
|
38 | - * @return \Illuminate\Notifications\Messages\MailMessage |
|
39 | - */ |
|
40 | - public function toMail($notifiable) |
|
41 | - { |
|
42 | - return (new MailMessage) |
|
43 | - ->subject('Email verification') |
|
44 | - ->line('Email verification') |
|
45 | - ->line('To validate your email click on the button below') |
|
46 | - ->action('Verify your email', config('skeleton.confrim_email_url') . '/' . $notifiable->confirmation_code); |
|
47 | - } |
|
34 | + /** |
|
35 | + * Get the mail representation of the notification. |
|
36 | + * |
|
37 | + * @param mixed $notifiable |
|
38 | + * @return \Illuminate\Notifications\Messages\MailMessage |
|
39 | + */ |
|
40 | + public function toMail($notifiable) |
|
41 | + { |
|
42 | + return (new MailMessage) |
|
43 | + ->subject('Email verification') |
|
44 | + ->line('Email verification') |
|
45 | + ->line('To validate your email click on the button below') |
|
46 | + ->action('Verify your email', config('skeleton.confrim_email_url') . '/' . $notifiable->confirmation_code); |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | \ No newline at end of file |