2024-02-02 19:16:11 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use App\Mail\LocationAppeal;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
|
|
|
|
class AppealMailController extends Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Send appeal request
|
|
|
|
*/
|
2024-02-05 21:02:27 +01:00
|
|
|
public function sendAppeal(Request $request)
|
2024-02-02 19:16:11 +01:00
|
|
|
{
|
|
|
|
//$order = Order::findOrFail($request->order_id);
|
2024-02-05 21:02:27 +01:00
|
|
|
$token = csrf_token();
|
2024-02-02 19:16:11 +01:00
|
|
|
|
2024-02-05 21:02:27 +01:00
|
|
|
if ($request->h1 != '' || $request->question != 2) {
|
|
|
|
return back()->withErrors([
|
|
|
|
'error' => 'Invalid Request',
|
|
|
|
]);
|
|
|
|
} else {
|
2024-02-08 20:07:49 +01:00
|
|
|
Mail::to(env('TBS_ADMIN_EMAIL'))->send(new LocationAppeal($request->location, $request->sponsor));
|
2024-02-02 19:16:11 +01:00
|
|
|
|
2024-02-05 21:02:27 +01:00
|
|
|
//return redirect('/appeals');
|
|
|
|
return back()->with('message', "Appeal Filed");
|
|
|
|
};
|
2024-02-02 19:16:11 +01:00
|
|
|
}
|
|
|
|
}
|