todo/app/Models/Label.php

25 lines
453 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Label extends Model
{
use HasFactory;
protected $fillable = [
'id',
'name',
'project_id',
'created_by_id',
];
public function tasks(): BelongsToMany
{
return $this->belongsToMany(Task::class);
}
}