diff --git a/app/Http/Controllers/AppealController.php b/app/Http/Controllers/AppealController.php new file mode 100644 index 0000000..c676a3d --- /dev/null +++ b/app/Http/Controllers/AppealController.php @@ -0,0 +1,49 @@ +order_id); + $token = csrf_token(); + + if ($request->h1 != '' || $request->question != 2) { + return back()->withErrors([ + 'error' => 'Invalid Request', + ]); + } else { + $check = Appeal::where("location", $request->location)->first(); + + if ($check) { + return back()->withErrors([ + 'error' => 'Appeal already in process for Location', + ]); + } else { + $new = Appeal::create([ + 'uuid' => Uuid::uuid4(), + 'location' => $request->location, + 'location_admin' => $request->location_admin, + 'sponsor' => $request->sponsor, + 'description' => $request->appeal_description, + 'approved' => false, + 'reviewed' => false, + ]); + Mail::to(env('TBS_ADMIN_EMAIL'))->send(new LocationAppeal($request->location, $request->sponsor)); + } + + //return redirect('/appeals'); + return back()->with('message', "Appeal Filed"); + }; + } +} diff --git a/app/Http/Controllers/AppealMailController.php b/app/Http/Controllers/AppealMailController.php deleted file mode 100644 index 476c830..0000000 --- a/app/Http/Controllers/AppealMailController.php +++ /dev/null @@ -1,30 +0,0 @@ -order_id); - $token = csrf_token(); - - if ($request->h1 != '' || $request->question != 2) { - return back()->withErrors([ - 'error' => 'Invalid Request', - ]); - } else { - Mail::to(env('TBS_ADMIN_EMAIL'))->send(new LocationAppeal($request->location, $request->sponsor)); - - //return redirect('/appeals'); - return back()->with('message', "Appeal Filed"); - }; - } -} diff --git a/app/Models/Appeal.php b/app/Models/Appeal.php new file mode 100644 index 0000000..9072639 --- /dev/null +++ b/app/Models/Appeal.php @@ -0,0 +1,34 @@ + section > article { min-height: 400px; } +textarea[name="appeal_description"] { + width: 300px; + height: 200px; +} + /* NAV */ #main-nav { diff --git a/resources/views/email/appeal.blade.php b/resources/views/email/appeal.blade.php index eb5b3ac..d1fc601 100644 --- a/resources/views/email/appeal.blade.php +++ b/resources/views/email/appeal.blade.php @@ -1,5 +1,3 @@