We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | $name = str_replace_first($this->rootNamespace(), '', $name); |
28 | 28 | |
29 | - return $this->laravel['path'].'/Models/'.str_replace('\\', '/', $name).'.php'; |
|
29 | + return $this->laravel[ 'path' ].'/Models/'.str_replace('\\', '/', $name).'.php'; |
|
30 | 30 | } |
31 | 31 | /** |
32 | 32 | * Get the root namespace for the class. |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | protected function rootNamespace() |
36 | 36 | { |
37 | - return $this->laravel->getNamespace() . 'Models'; |
|
37 | + return $this->laravel->getNamespace().'Models'; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | parent::__construct(); |
49 | 49 | } |
50 | - */ |
|
50 | + */ |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Execute the console command. |
@@ -58,5 +58,5 @@ discard block |
||
58 | 58 | { |
59 | 59 | // |
60 | 60 | } |
61 | - */ |
|
61 | + */ |
|
62 | 62 | } |
@@ -19,8 +19,8 @@ |
||
19 | 19 | // Extend the Validator class. |
20 | 20 | // To check the user age (minimum: 16) |
21 | 21 | Validator::extend( |
22 | - 'olderThan', function ($attributes, $value, $parameters) { |
|
23 | - $minAge = ( ! empty($parameters)) ? (int) $parameters[0] : 16; |
|
22 | + 'olderThan', function($attributes, $value, $parameters) { |
|
23 | + $minAge = (!empty($parameters)) ? (int) $parameters[ 0 ] : 16; |
|
24 | 24 | return \Carbon\Carbon::now()->diff(new \Carbon\Carbon($value))->y >= $minAge; |
25 | 25 | } |
26 | 26 | ); |
@@ -99,7 +99,7 @@ |
||
99 | 99 | ); |
100 | 100 | } |
101 | 101 | |
102 | - // Notify error in not found |
|
102 | + // Notify error in not found |
|
103 | 103 | if (!$comment) { |
104 | 104 | return response()->json( |
105 | 105 | [ |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $camp = Campaign::find($campaign); |
33 | 33 | $comment = new Comment(); |
34 | 34 | $comment->id = str_random(); |
35 | - $comment->comment = $request['comment']; |
|
35 | + $comment->comment = $request[ 'comment' ]; |
|
36 | 36 | $comment->user_id = $user->id; |
37 | 37 | $comment->campaign_id = $camp->id; |
38 | 38 | // $comment->created_at = Carbon::now(); |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | ); |
64 | 64 | } |
65 | 65 | |
66 | - $comment->comment = $request['comment']; |
|
66 | + $comment->comment = $request[ 'comment' ]; |
|
67 | 67 | |
68 | - if (! $comment) { |
|
68 | + if (!$comment) { |
|
69 | 69 | return response()->json( |
70 | 70 | [ |
71 | 71 | 'error_code' => 404, |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $user = JWTAuth::parseToken()->authenticate(); |
23 | 23 | |
24 | 24 | $invite = new Invite(); |
25 | - $invite->invite_code = Hash::make($request['invite_code']); |
|
25 | + $invite->invite_code = Hash::make($request[ 'invite_code' ]); |
|
26 | 26 | $invite->user_id = $user->id; |
27 | 27 | $invite->save(); |
28 | 28 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | * |
40 | 40 | * These routes all receive session state, CSRF protection, etc. |
41 | 41 | */ |
42 | - /* |
|
42 | + /* |
|
43 | 43 | protected function mapWebRoutes() |
44 | 44 | { |
45 | 45 | Route::group( |
@@ -64,7 +64,7 @@ |
||
64 | 64 | [ |
65 | 65 | 'middleware' => 'api', |
66 | 66 | 'namespace' => $this->namespace, |
67 | - ], function ($router) { |
|
67 | + ], function($router) { |
|
68 | 68 | include base_path('routes/api.php'); |
69 | 69 | } |
70 | 70 | ); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * |
20 | 20 | * @param Request $request |
21 | 21 | * @return void |
22 | - */ |
|
22 | + */ |
|
23 | 23 | public function authenticate(Request $request) |
24 | 24 | { |
25 | 25 | // grab credentials from the request |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * Authenticate the user |
19 | 19 | * |
20 | 20 | * @param Request $request |
21 | - * @return void |
|
21 | + * @return \Illuminate\Http\JsonResponse |
|
22 | 22 | */ |
23 | 23 | public function authenticate(Request $request) |
24 | 24 | { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * Get all campaigns |
27 | 27 | * 20 queries per page |
28 | 28 | * |
29 | - * @return void |
|
29 | + * @return \Illuminate\Http\JsonResponse |
|
30 | 30 | */ |
31 | 31 | public function index() |
32 | 32 | { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * Get all details of a campaign |
40 | 40 | * |
41 | 41 | * @param integer $id |
42 | - * @return void |
|
42 | + * @return \Illuminate\Http\JsonResponse |
|
43 | 43 | */ |
44 | 44 | public function show($id) |
45 | 45 | { |
@@ -2,14 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace DoeSangue\Http\Controllers\API\V1; |
4 | 4 | |
5 | -use DoeSangue\Http\Requests\UpdateCampaignRequest; |
|
6 | -use DoeSangue\Http\Requests\CreateCampaignRequest; |
|
7 | 5 | use DoeSangue\Http\Controllers\Controller; |
8 | -use Illuminate\Support\Facades\Mail; |
|
9 | -use DoeSangue\Models\Donor; |
|
10 | 6 | use DoeSangue\Models\Campaign; |
11 | -use Carbon\Carbon; |
|
12 | -use Tymon\JWTAuth\Facades\JWTAuth; |
|
13 | 7 | |
14 | 8 | class CampaignController extends Controller |
15 | 9 | { |
@@ -12,7 +12,7 @@ |
||
12 | 12 | /** |
13 | 13 | * Get Logged in User information. |
14 | 14 | * |
15 | - * @return void |
|
15 | + * @return \Illuminate\Http\JsonResponse |
|
16 | 16 | */ |
17 | 17 | public function userInfo() |
18 | 18 | { |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace DoeSangue\Http\Controllers\API\V1\User; |
4 | 4 | |
5 | 5 | use JWTAuth; |
6 | -use Tymon\JWTAuth\Exceptions\JWTException; |
|
7 | 6 | use Illuminate\Http\Request; |
8 | 7 | use DoeSangue\Http\Controllers\Controller; |
9 | 8 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | 'email' => $user->email, |
31 | 31 | 'username' => $user->username, |
32 | 32 | 'blood_type' => $user->donor->bloodType->code, |
33 | - 'avatar' => '',//$user->avatar, |
|
33 | + 'avatar' => '', //$user->avatar, |
|
34 | 34 | 'birthdate' => $user->birthdate, |
35 | 35 | 'phone' => $user->phone, |
36 | 36 | 'bio' => $user->bio |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | /** |
14 | 14 | * Get all campaigns from current logged-in user. |
15 | 15 | * |
16 | - * @return void |
|
16 | + * @return \Illuminate\Http\JsonResponse|null |
|
17 | 17 | */ |
18 | 18 | public function all() |
19 | 19 | { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * Create a new campaign |
33 | 33 | * |
34 | 34 | * @param CreateCampaignRequest $request |
35 | - * @return void |
|
35 | + * @return \Illuminate\Http\JsonResponse |
|
36 | 36 | */ |
37 | 37 | public function store(CreateCampaignRequest $request) |
38 | 38 | { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param UpdateCampaignRequest $request |
68 | 68 | * @param integer $id |
69 | - * @return void |
|
69 | + * @return \Illuminate\Http\JsonResponse |
|
70 | 70 | */ |
71 | 71 | public function update(UpdateCampaignRequest $request, $id) |
72 | 72 | { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * Delete the campaign from platform. |
122 | 122 | * |
123 | 123 | * @param integer $id |
124 | - * @return void |
|
124 | + * @return \Illuminate\Http\JsonResponse |
|
125 | 125 | */ |
126 | 126 | public function destroy($id) |
127 | 127 | { |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace DoeSangue\Http\Controllers\API\V1\User; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | 5 | use DoeSangue\Http\Controllers\Controller; |
7 | 6 | |
8 | 7 | use DoeSangue\Models\Campaign; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | $user = JWTAuth::parseToken()->authenticate(); |
22 | 22 | |
23 | - // If the token is invalid |
|
23 | + // If the token is invalid |
|
24 | 24 | if (!$user) { |
25 | 25 | return response()->json([ 'invalid_user' ], 401); |
26 | 26 | } |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | 'owner' => [ |
107 | 107 | 'first_name' => $campaign->owner->first_name, |
108 | 108 | 'last_name' => $campaign->owner->last_name, |
109 | - // 'email' => $campaign->owner->email, |
|
110 | - // 'username' => $campaign->owner->username |
|
109 | + // 'email' => $campaign->owner->email, |
|
110 | + // 'username' => $campaign->owner->username |
|
111 | 111 | ], |
112 | 112 | 'dates' => [ |
113 | 113 | 'start_at' => $campaign->created_at->format('d-m-Y h:m:s'), |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | $campaign = new Campaign(); |
34 | 34 | $campaign->title = $request[ 'title' ]; |
35 | - $campaign->description = $request['description']; |
|
35 | + $campaign->description = $request[ 'description' ]; |
|
36 | 36 | $campaign->expires = $request[ 'expires' ]; |
37 | 37 | // $campaign->user_id = $request[ 'user_id' ]; |
38 | 38 | // use auth guard instead of $request['user_id']. |