@@ -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 | ]; |
@@ -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 | ]; |
@@ -8,53 +8,53 @@ |
||
8 | 8 | |
9 | 9 | class UpdateLocaleAndTimezone |
10 | 10 | { |
11 | - protected $session; |
|
12 | - protected $auth; |
|
11 | + protected $session; |
|
12 | + protected $auth; |
|
13 | 13 | |
14 | - /** |
|
15 | - * Init new object. |
|
16 | - * |
|
17 | - * @param Session $session |
|
18 | - * @param Auth $auth |
|
19 | - * @param Errors $errors |
|
20 | - * |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function __construct(Session $session, Auth $auth) |
|
24 | - { |
|
25 | - $this->session = $session; |
|
26 | - $this->auth = $auth; |
|
27 | - } |
|
14 | + /** |
|
15 | + * Init new object. |
|
16 | + * |
|
17 | + * @param Session $session |
|
18 | + * @param Auth $auth |
|
19 | + * @param Errors $errors |
|
20 | + * |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function __construct(Session $session, Auth $auth) |
|
24 | + { |
|
25 | + $this->session = $session; |
|
26 | + $this->auth = $auth; |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * Handle an incoming request. |
|
31 | - * |
|
32 | - * @param \Illuminate\Http\Request $request |
|
33 | - * @param \Closure $next |
|
34 | - * @return mixed |
|
35 | - */ |
|
36 | - public function handle($request, Closure $next) |
|
37 | - { |
|
38 | - $update = false; |
|
39 | - $user = $this->auth->user(); |
|
40 | - if ($user) { |
|
41 | - $locale = $this->session->get('locale'); |
|
42 | - $timezone = $this->session->get('time-zone'); |
|
43 | - if ($locale && $locale !== 'all' && $locale !== $user->locale) { |
|
44 | - $user->locale = $locale; |
|
45 | - $update = true; |
|
46 | - } |
|
29 | + /** |
|
30 | + * Handle an incoming request. |
|
31 | + * |
|
32 | + * @param \Illuminate\Http\Request $request |
|
33 | + * @param \Closure $next |
|
34 | + * @return mixed |
|
35 | + */ |
|
36 | + public function handle($request, Closure $next) |
|
37 | + { |
|
38 | + $update = false; |
|
39 | + $user = $this->auth->user(); |
|
40 | + if ($user) { |
|
41 | + $locale = $this->session->get('locale'); |
|
42 | + $timezone = $this->session->get('time-zone'); |
|
43 | + if ($locale && $locale !== 'all' && $locale !== $user->locale) { |
|
44 | + $user->locale = $locale; |
|
45 | + $update = true; |
|
46 | + } |
|
47 | 47 | |
48 | - if ($timezone && $timezone !== $user->timezone) { |
|
49 | - $user->timezone = $timezone; |
|
50 | - $update = true; |
|
51 | - } |
|
48 | + if ($timezone && $timezone !== $user->timezone) { |
|
49 | + $user->timezone = $timezone; |
|
50 | + $update = true; |
|
51 | + } |
|
52 | 52 | |
53 | - if ($update) { |
|
54 | - $user->save(); |
|
55 | - } |
|
56 | - } |
|
53 | + if ($update) { |
|
54 | + $user->save(); |
|
55 | + } |
|
56 | + } |
|
57 | 57 | |
58 | - return $next($request); |
|
59 | - } |
|
58 | + return $next($request); |
|
59 | + } |
|
60 | 60 | } |
@@ -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 | } |
@@ -6,58 +6,58 @@ |
||
6 | 6 | |
7 | 7 | class OauthClientsTableSeeder 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 oauthClients table. |
|
18 | - */ |
|
19 | - \DB::table('permissions')->insert( |
|
20 | - [ |
|
21 | - /** |
|
22 | - * OauthClients model permissions. |
|
23 | - */ |
|
24 | - [ |
|
25 | - 'name' => 'index', |
|
26 | - 'model' => 'oauthClient', |
|
27 | - 'created_at' => \DB::raw('NOW()'), |
|
28 | - 'updated_at' => \DB::raw('NOW()') |
|
29 | - ], |
|
30 | - [ |
|
31 | - 'name' => 'show', |
|
32 | - 'model' => 'oauthClient', |
|
33 | - 'created_at' => \DB::raw('NOW()'), |
|
34 | - 'updated_at' => \DB::raw('NOW()') |
|
35 | - ], |
|
36 | - [ |
|
37 | - 'name' => 'store', |
|
38 | - 'model' => 'oauthClient', |
|
39 | - 'created_at' => \DB::raw('NOW()'), |
|
40 | - 'updated_at' => \DB::raw('NOW()') |
|
41 | - ], |
|
42 | - [ |
|
43 | - 'name' => 'update', |
|
44 | - 'model' => 'oauthClient', |
|
45 | - 'created_at' => \DB::raw('NOW()'), |
|
46 | - 'updated_at' => \DB::raw('NOW()') |
|
47 | - ], |
|
48 | - [ |
|
49 | - 'name' => 'revoke', |
|
50 | - 'model' => 'oauthClient', |
|
51 | - 'created_at' => \DB::raw('NOW()'), |
|
52 | - 'updated_at' => \DB::raw('NOW()') |
|
53 | - ], |
|
54 | - [ |
|
55 | - 'name' => 'unRevoke', |
|
56 | - 'model' => 'oauthClient', |
|
57 | - 'created_at' => \DB::raw('NOW()'), |
|
58 | - 'updated_at' => \DB::raw('NOW()') |
|
59 | - ], |
|
60 | - ] |
|
61 | - ); |
|
62 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + /** |
|
17 | + * Insert the permissions related to oauthClients table. |
|
18 | + */ |
|
19 | + \DB::table('permissions')->insert( |
|
20 | + [ |
|
21 | + /** |
|
22 | + * OauthClients model permissions. |
|
23 | + */ |
|
24 | + [ |
|
25 | + 'name' => 'index', |
|
26 | + 'model' => 'oauthClient', |
|
27 | + 'created_at' => \DB::raw('NOW()'), |
|
28 | + 'updated_at' => \DB::raw('NOW()') |
|
29 | + ], |
|
30 | + [ |
|
31 | + 'name' => 'show', |
|
32 | + 'model' => 'oauthClient', |
|
33 | + 'created_at' => \DB::raw('NOW()'), |
|
34 | + 'updated_at' => \DB::raw('NOW()') |
|
35 | + ], |
|
36 | + [ |
|
37 | + 'name' => 'store', |
|
38 | + 'model' => 'oauthClient', |
|
39 | + 'created_at' => \DB::raw('NOW()'), |
|
40 | + 'updated_at' => \DB::raw('NOW()') |
|
41 | + ], |
|
42 | + [ |
|
43 | + 'name' => 'update', |
|
44 | + 'model' => 'oauthClient', |
|
45 | + 'created_at' => \DB::raw('NOW()'), |
|
46 | + 'updated_at' => \DB::raw('NOW()') |
|
47 | + ], |
|
48 | + [ |
|
49 | + 'name' => 'revoke', |
|
50 | + 'model' => 'oauthClient', |
|
51 | + 'created_at' => \DB::raw('NOW()'), |
|
52 | + 'updated_at' => \DB::raw('NOW()') |
|
53 | + ], |
|
54 | + [ |
|
55 | + 'name' => 'unRevoke', |
|
56 | + 'model' => 'oauthClient', |
|
57 | + 'created_at' => \DB::raw('NOW()'), |
|
58 | + 'updated_at' => \DB::raw('NOW()') |
|
59 | + ], |
|
60 | + ] |
|
61 | + ); |
|
62 | + } |
|
63 | 63 | } |
@@ -8,50 +8,50 @@ |
||
8 | 8 | |
9 | 9 | class OauthClientController extends BaseApiController |
10 | 10 | { |
11 | - /** |
|
12 | - * Path of the sotre form request. |
|
13 | - * |
|
14 | - * @var string |
|
15 | - */ |
|
16 | - protected $storeFormRequest = 'App\Modules\OauthClients\Http\Requests\StoreOauthClient'; |
|
11 | + /** |
|
12 | + * Path of the sotre form request. |
|
13 | + * |
|
14 | + * @var string |
|
15 | + */ |
|
16 | + protected $storeFormRequest = 'App\Modules\OauthClients\Http\Requests\StoreOauthClient'; |
|
17 | 17 | |
18 | - /** |
|
19 | - * Path of the model resource |
|
20 | - * |
|
21 | - * @var string |
|
22 | - */ |
|
23 | - protected $modelResource = 'App\Modules\OauthClients\Http\Resources\OauthClient'; |
|
18 | + /** |
|
19 | + * Path of the model resource |
|
20 | + * |
|
21 | + * @var string |
|
22 | + */ |
|
23 | + protected $modelResource = 'App\Modules\OauthClients\Http\Resources\OauthClient'; |
|
24 | 24 | |
25 | - /** |
|
26 | - * Init new object. |
|
27 | - * |
|
28 | - * @param OauthClientService $service |
|
29 | - * @return void |
|
30 | - */ |
|
31 | - public function __construct(OauthClientService $service) |
|
32 | - { |
|
33 | - parent::__construct($service); |
|
34 | - } |
|
25 | + /** |
|
26 | + * Init new object. |
|
27 | + * |
|
28 | + * @param OauthClientService $service |
|
29 | + * @return void |
|
30 | + */ |
|
31 | + public function __construct(OauthClientService $service) |
|
32 | + { |
|
33 | + parent::__construct($service); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Revoke the given client. |
|
38 | - * |
|
39 | - * @param integer $clientId Id of the client |
|
40 | - * @return \Illuminate\Http\Response |
|
41 | - */ |
|
42 | - public function revoke($clientId) |
|
43 | - { |
|
44 | - return new GeneralResource($this->service->revoke($clientId)); |
|
45 | - } |
|
36 | + /** |
|
37 | + * Revoke the given client. |
|
38 | + * |
|
39 | + * @param integer $clientId Id of the client |
|
40 | + * @return \Illuminate\Http\Response |
|
41 | + */ |
|
42 | + public function revoke($clientId) |
|
43 | + { |
|
44 | + return new GeneralResource($this->service->revoke($clientId)); |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * Un revoke the given client. |
|
49 | - * |
|
50 | - * @param integer $clientId Id of the client |
|
51 | - * @return \Illuminate\Http\Response |
|
52 | - */ |
|
53 | - public function unRevoke($clientId) |
|
54 | - { |
|
55 | - return new GeneralResource($this->service->unRevoke($clientId)); |
|
56 | - } |
|
47 | + /** |
|
48 | + * Un revoke the given client. |
|
49 | + * |
|
50 | + * @param integer $clientId Id of the client |
|
51 | + * @return \Illuminate\Http\Response |
|
52 | + */ |
|
53 | + public function unRevoke($clientId) |
|
54 | + { |
|
55 | + return new GeneralResource($this->service->unRevoke($clientId)); |
|
56 | + } |
|
57 | 57 | } |