Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel controller in details

 public function store(PersonalInfoRequest $request)
    {
//        1.validation

        try {
//            except csrf token from form
            $data = request()->except(['_token']);
//            convert lower case value to upper case from array
            $check = array_map('strtoupper', $data);
//            insert all upper case value once in DB
            $value = PersonalInformationModel::Insert($check);

            DB::commit();
        if($value){
            $this->JsonData['status'] = 'success';
            $this->JsonData['url'] = route('reservation.index');
            $this->JsonData['msg'] = 'Succesfully stored Personal details';
            }
        }
        catch(Exception $e) {

            $this->JsonData['msg'] = 'Something wen`t wrong on server! Please try again';
            $this->JsonData['status'] = $e->getMessage();
            DB::rollback();
        }

        return response()->json($this->JsonData);
    }
Comment

laravel controller

php artisan make:controller FormIndexController
Comment

PREVIOUS NEXT
Code Example
Php :: php clear cache 
Php :: php artisan serve on lumen 
Php :: guzzlehttp/guzzle version with laravel-websockek 
Php :: check if string contains only whitespace php 
Php :: wp-config for developement 
Php :: laravel upload base64 image 
Php :: php check if a url exists 
Php :: check if string contains substring php 8 
Php :: php comment 
Php :: laral db innodb 
Php :: php variable in echo 
Php :: ckeditor laravel 
Php :: In PackageManifest.php line 122: Undefined index: name 
Php :: php check if associative array 
Php :: get curret timedate php 
Php :: carbon check if date is greater 
Php :: get nearby from longitude and latitude in laravel 
Php :: how to see php error log 
Php :: php microtime to ms 
Php :: if url has certain code then php 
Php :: check if value change laravel 
Php :: php check if multiple inputs are empty 
Php :: woocommerce hook after order placed 
Php :: wp_list_pluck 
Php :: session_start cookie lifetime 
Php :: livewire datatable Delete column momentarily triggering confirmation dialog of last row during page load 
Php :: put woocommerce orders on pending payment automatically 
Php :: laravel find duplicate rows 
Php :: how to set select option value dynamically in php 
Php :: __invoke in laravel 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =