(Update) Controller + Commands Query Syntax

- using shorter and more readable syntax
- remove “=“ in where clauses
- uses oldest() / latest() instead of like orderBy('created_at', 'DESC')
This commit is contained in:
HDVinnie
2018-03-24 16:42:59 -04:00
parent e3e21896e2
commit 32e8b1c62b
38 changed files with 219 additions and 219 deletions
+2 -2
View File
@@ -45,8 +45,8 @@ class InviteController extends Controller
if ($invites_restricted && !in_array($user->group->name, $invite_groups)) {
return redirect()->route('invite')->with(Toastr::error('Invites are currently disabled for your userclass.', 'Whoops!', ['options']));
}
$exsist = Invite::where('email', '=', $request->input('email'))->first();
$member = User::where('email', '=', $request->input('email'))->first();
$exsist = Invite::where('email', $request->input('email'))->first();
$member = User::where('email', $request->input('email'))->first();
if ($exsist || $member) {
return redirect()->route('invite')->with(Toastr::error('The email address your trying to send a invite to has already been sent one or is a user already.', 'Whoops!', ['options']));
}