added cast for enabled field

This commit is contained in:
Denis Duliçi 2020-07-27 13:08:26 +03:00
parent 330aee0dde
commit aa604b7056
3 changed files with 17 additions and 0 deletions

View File

@ -18,6 +18,10 @@ abstract class Model extends Eloquent
protected $dates = ['deleted_at'];
protected $casts = [
'enabled' => 'boolean',
];
/**
* The "booting" method of the model.
*

View File

@ -42,6 +42,15 @@ class User extends Authenticatable
*/
protected $dates = ['last_logged_in_at', 'created_at', 'updated_at', 'deleted_at'];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'enabled' => 'boolean',
];
/**
* Sortable columns.
*

View File

@ -21,6 +21,10 @@ class Company extends Eloquent
protected $fillable = ['domain', 'enabled'];
protected $casts = [
'enabled' => 'boolean',
];
/**
* Sortable columns.
*