Laravel insert query


Laravel insert query : Laravel Insert Records Into A Table


Syntax for laravel insert Query

DB::table('table_name')->insert('data_array');

Laravel insert Query Example

DB::table('users')->insert(array("id"=>$uid,"name"=>$name,"email"=>$email));

or You can also use this :

$data = array("id"=>$uid,"name"=>$name,"email"=>$email);
DB::table('users')->insert($data);

Advertisements

Add Comment

📖 Read More