%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/crm-ind-code/app/Http/Controllers/Backend/
Upload File :
Create Path :
Current File : //home/silvzytp/crm-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 = [
                'client_name'=>$request->client_name,
                'subject'=>$request->subject,
                'message'=>$request->message
            ];

            try {
                Mail::to('leadsdxbguru@gmail.com')
                    ->cc(['almamun.dev21@gmail.com','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