diff --git a/app/Abstracts/Model.php b/app/Abstracts/Model.php index 951a5963f..f2fd309ea 100644 --- a/app/Abstracts/Model.php +++ b/app/Abstracts/Model.php @@ -18,6 +18,10 @@ abstract class Model extends Eloquent protected $dates = ['deleted_at']; + protected $casts = [ + 'enabled' => 'boolean', + ]; + /** * The "booting" method of the model. * diff --git a/app/Models/Auth/User.php b/app/Models/Auth/User.php index be1268dcf..f8c7e94e0 100644 --- a/app/Models/Auth/User.php +++ b/app/Models/Auth/User.php @@ -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. * diff --git a/app/Models/Common/Company.php b/app/Models/Common/Company.php index 2da164874..32390caa6 100644 --- a/app/Models/Common/Company.php +++ b/app/Models/Common/Company.php @@ -21,6 +21,10 @@ class Company extends Eloquent protected $fillable = ['domain', 'enabled']; + protected $casts = [ + 'enabled' => 'boolean', + ]; + /** * Sortable columns. *