Task 3 - multi-level relationships

This commit is contained in:
PovilasKorop
2021-11-22 07:39:27 +02:00
parent 9c71409ffc
commit 0fbdf0c99a
8 changed files with 108 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
<?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);
}
}