40 lines
788 B
PHP
40 lines
788 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class InterventionAttachment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'intervention_id',
|
|
'file_id',
|
|
'label'
|
|
];
|
|
|
|
/**
|
|
* Get the intervention associated with the attachment.
|
|
*/
|
|
public function intervention(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Intervention::class);
|
|
}
|
|
|
|
/**
|
|
* Get the file associated with the attachment.
|
|
*/
|
|
public function file(): BelongsTo
|
|
{
|
|
return $this->belongsTo(File::class);
|
|
}
|
|
}
|