Search
 
SCRIPT & CODE EXAMPLE
 

PHP

multe data on database laravel

$data = $request->all();
$finalArray = array();
foreach($data as $key=>$value){
   array_push($finalArray, array(
                'fltno'=>$value['sflt'],
                'model'=>$value['smodel'],
                'engine'=>$value['sengine'],
                'loc'=>$value['sloc'],
                'serviceType'=>$value['sstye'],
                'nextSvr'=> $value['snsvr'] )
   );
});

Model::insert($finalArray);
Comment

PREVIOUS NEXT
Code Example
Php :: laravel collection get 
Php :: laravel pagination 
Php :: php namespace class 
Php :: laravel 8 resource 
Php :: laravel migration type to store html 
Php :: match php 
Php :: laravel validation check foreign key exists 
Php :: laravel route pattern 
Php :: carbon date time laravel 
Php :: laravel_login 
Php :: Get data from array (from an API) in Laravel 
Php :: do_shortcode not working 
Php :: How to Get Radio Button Value in PHP Without Submit 
Php :: php get array key like 
Php :: how to create a php website 
Php :: -sale_price 
Php :: laravel migration char length 
Php :: htaccess new date timestamp 
Php :: get dates between two dates using specific interval using carbon 
Php :: wp large medium large 
Php :: is resource php 8 
Php :: laravel swagger 
Php :: err_cache_miss php 
Php :: assign to array array of values php 
Php :: php timezone paris 
Php :: livewire custom attribute 
Php :: eloquent firstorcreate 
Php :: laravel withwhere 
Php :: laravel how to query belongsTo relationship 
Php :: 0 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =