ldc-supportweb/app/Models/Project.php
2023-08-14 09:23:39 +00:00

49 lines
896 B
PHP

<?php
namespace App\Models;
use App\Enums\Projects\ProjectStatusEnum;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @property string $name
* @property ProjectStatusEnum $status
* @property Site $site_id
*/
class Project extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'status',
'site_id'
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'status' => ProjectStatusEnum::class
];
// * RELATIONSHIPS.
/**
* BelongsTo Site
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function site()
{
return $this->belongsTo(Site::class);
}
}