mirror of
https://github.com/10h30/Test-Eloquent-Relationships.git
synced 2026-06-05 15:07:42 +09:00
19 lines
323 B
PHP
19 lines
323 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Comment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = ['task_id', 'name', 'comment'];
|
|
|
|
public function task()
|
|
{
|
|
return $this->belongsTo(Task::class);
|
|
}
|
|
}
|