How to use custom table in Laravel Model ?

We can use custom table in Laravel by overriding protected $table property of Eloquent. Below is sample uses

class User extends Eloquent{
 protected $table="my_custom_table";

}  

Leave a Reply

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