With Laravel, each database table can have a model representation using a model file which can be used to interact with that table using Laravel Eloquent ORM.
We can create a model using this artisan command:
php artisan make:model Post
This will create a file in the models’ directory and will look like below:
class Post extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [];
}
A Model can have properties like table, fillable, hidden, etc which defines properties of the table and model.