%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/ccd-ind-code/app/Http/Controllers/Backend/
Upload File :
Create Path :
Current File : //home/silvzytp/ccd-ind-code/app/Http/Controllers/Backend/SupportController.php

<?php

namespace App\Http\Controllers\Backend;

use App\Mail\SupportMail;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Mail;
use App\Http\Requests\SupportRequest;
use Illuminate\Support\Facades\DB;

class SupportController extends Controller
{
    public function support(SupportRequest $request){
        if ($request->ajax()) {
            DB::beginTransaction();

            $mailContent = [
                'subject'=>$request->subject,
                'message'=>$request->message
            ];

            try {
                Mail::to('it@silveroak.ae')
                    ->cc('sujonbdjoin019@gmail.com')
                    ->later(now()->addSeconds(10), new SupportMail($mailContent));

                $output = ['status'=>'success','message'=>'Support ticket successful.'];
                DB::commit();
            } catch (\Exception $e) {
                DB::rollBack();
                $output = ['status'=>'error','message'=>$e->getMessage()];
            }

            return response()->json($output);
        }
    }
}

Zerion Mini Shell 1.0