How to create a record in Laravel using eloquent ?

To create a new record in the database using Laravel Eloquent, simply create a new model instance, set attributes on the model, then call the save method: Here is sample Usage.

public function saveProduct(Request $request )
 $product = new product;
 $product->name = $request->name;
 $product->description = $request->name;
 $product->save(); 

One thought to “How to create a record in Laravel using eloquent ?”

  1. Way cool! Some extremely valid points! I appreciate you writing this post plus the rest of the site is extremely good.

Leave a Reply

Your email address will not be published. Required fields are marked *