'integer', 'is_active' => 'boolean', ]; /** * Get the machine assignments for this advertisement. */ public function machineAdvertisements() { return $this->hasMany(MachineAdvertisement::class); } /** * Get the company that owns the advertisement. */ public function company() { return $this->belongsTo(Company::class); } /** * Scope a query to only include active advertisements. */ public function scopeActive($query) { return $query->where('is_active', true); } }