Search
 
SCRIPT & CODE EXAMPLE
 

PHP

try/catch --> much needed

public function sendContactForm(SendContactFormRequest $request)
{
    try {
        $data = [
            'name' => $request->get('name'),
            'email' => $request->get('email'),
            'phone' => $request->get('phone'),
            'message' => $request->get('message'),
        ];
        // SEND EMAIL
        $this->sendNotification($data);

        return redirect()
            ->back()
            ->with('success', trans('web.'));

    } catch (Exception $e) {
        return redirect()
            ->back()
            ->with('danger', $e->getMessage());
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: multi file delete in php 
Php :: write to error log opencart 
Php :: after jquery validation ajax call in php 
Php :: does grepper use PHP 
Php :: To Search Specific Post Type 
Php :: laravel orm latest() 
Php :: lista 
Php :: what does php stand for 
Php :: How to Validate an Email Duplicate Entry in Codeigniter 
Php :: laravel creating_table_name 
Php :: one to one relationship laravel 
Php :: add backslash to path wordpress 
Php :: m 
Php :: laravel creating event get data 
Php :: php if form fails keep data 
Php :: php obtener slug wordpress 
Php :: section laravel append 
Php :: plesk change php version 
Php :: auto complete order paid1 
Php :: vriadic function in php 
Php :: run specific seeder laravel 
Php :: webiste url filter with pregx 
Php :: Print all before characters once string found | matched string return 
Php :: php define() 
Php :: get first row of array php 
Php :: codeigniter pagination example 
Php :: php zoom api start_time issue 
Php :: File: C:xampphtdocsmarvellogistikapplicationlibrariesProfiler.php Line: 386 Function: sendDataInHeaders 
Php :: Program to Multiply Two Numbers in php 
Php :: laravel slug for non-english words too 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =