Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Dispatch, performance

class ContactController extends Controller
{
    /**
     * Store a new podcast.
     *
     * @param    Request  $request
     * @return  JsonResponse
     */
    public function store(ContactFormRequest $request)
    {
        $request->storeContactFormDetails();
 
        dispatch(function () {
             Mail::to('mail@ashallendesign.co.uk')->send(new ContactFormSubmission);
         })->afterResponse();
 
        return response()->json(['success' => true]);
    }
}
Source by ashallendesign.co.uk #
 
PREVIOUS NEXT
Tagged: #performance
ADD COMMENT
Topic
Name
4+6 =