feat: add all Eloquent models with relationships
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class AuditResponse extends Model
|
||||
{
|
||||
protected $fillable = ['audit_id', 'responded_by', 'response_text'];
|
||||
|
||||
public function audit(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Audit::class);
|
||||
}
|
||||
|
||||
public function responder(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'responded_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user