We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 2 |
Paths | 2 |
Total Lines | 33 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function createInvitation(Request $request) |
||
19 | { |
||
20 | |||
21 | $guestExist = DB::table('invitation_requests') |
||
22 | ->where('guest_email', $request['guest_email'])->first(); |
||
23 | |||
24 | if (!$guestExist) { |
||
25 | $guest = [ |
||
26 | 'first_name' => $request->first_name, |
||
27 | 'last_name' => $request->last_name, |
||
28 | 'guest_email' => $request->guest_email, |
||
29 | 'country_id' => $request->country_id, |
||
30 | 'token' => Hash::make(str_random(60)), |
||
|
|||
31 | 'created_at' => \Carbon\Carbon::now(), |
||
32 | 'updated_at' => \Carbon\Carbon::now() |
||
33 | ]; |
||
34 | |||
35 | DB::table('invitation_requests')->insert($guest); |
||
36 | |||
37 | return response()->json( |
||
38 | [ |
||
39 | 'message' => 'Urrah! You have been invited. Check you email for more information.' |
||
40 | ], 201 |
||
41 | ); |
||
42 | } else { |
||
43 | return response()->json( |
||
44 | [ |
||
45 | 'message' => 'Oops. Looks like you have been invited already. But don\'t scary, we will send you again!' |
||
46 | ], 200 |
||
47 | ); |
||
48 | } |
||
49 | |||
50 | } |
||
51 | |||
62 |
This function has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.