2021-07-24 14:20:56 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
2023-08-14 09:23:39 +00:00
|
|
|
/**
|
|
|
|
|
* @property string $name
|
|
|
|
|
* @property Site $site_id
|
|
|
|
|
*/
|
2021-07-24 14:20:56 +02:00
|
|
|
class Project extends Model
|
|
|
|
|
{
|
|
|
|
|
use HasFactory;
|
|
|
|
|
|
2022-04-26 12:15:31 +02:00
|
|
|
/**
|
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
|
*
|
2025-04-08 11:47:49 +02:00
|
|
|
* @var list<string>
|
2022-04-26 12:15:31 +02:00
|
|
|
*/
|
2021-07-25 19:11:33 +02:00
|
|
|
protected $fillable = [
|
2023-08-14 09:23:39 +00:00
|
|
|
'name',
|
|
|
|
|
'site_id'
|
2021-07-25 19:11:33 +02:00
|
|
|
];
|
2021-07-24 14:20:56 +02:00
|
|
|
|
2022-04-26 12:15:31 +02:00
|
|
|
// * RELATIONSHIPS.
|
|
|
|
|
|
|
|
|
|
/**
|
2022-08-30 06:41:39 +00:00
|
|
|
* BelongsTo Site
|
2022-04-26 12:15:31 +02:00
|
|
|
*
|
2022-08-30 06:41:39 +00:00
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
2022-04-26 12:15:31 +02:00
|
|
|
*/
|
2025-04-08 11:47:49 +02:00
|
|
|
public function site(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
2021-07-25 19:11:33 +02:00
|
|
|
{
|
2022-08-30 06:41:39 +00:00
|
|
|
return $this->belongsTo(Site::class);
|
2021-07-25 19:11:33 +02:00
|
|
|
}
|
2021-07-24 14:20:56 +02:00
|
|
|
}
|