|bool */ protected $guarded = ['id']; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'active' => 'boolean', 'delible' => 'boolean', ]; /** * Get the account record associated with the module. * * @return BelongsTo */ public function account() { return $this->belongsTo(Account::class); } /** * Scope a query to only include modules that are active. * * @param \Illuminate\Database\Eloquent\Builder $query * @return \Illuminate\Database\Eloquent\Builder */ public function scopeActive($query) { return $query->where('active', true); } }