ultimatepos/app/Modules/Maintenance/Models/ServiceProvider.php

39 lines
828 B
PHP

<?php
namespace App\Modules\Maintenance\Models;
use App\Business;
use App\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class ServiceProvider extends Model
{
use SoftDeletes;
protected $table = 'maintenance_service_providers';
protected $fillable = [
'business_id', 'name', 'provider_type', 'capability', 'specialties',
'phone', 'email', 'linked_user_id', 'notes', 'is_active',
];
protected $casts = [
'specialties' => 'array',
'is_active' => 'boolean',
];
protected static function booted(): void
{ }
public function business()
{
return $this->belongsTo(Business::class);
}
public function linkedUser()
{
return $this->belongsTo(User::class, 'linked_user_id');
}
}