<?php

namespace App\Models;

use App\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class ToDoList extends Model
{
    protected $guarded = [];

    public function path()
    {
        return '/to-do-lists/' . $this->id;
    }

    public function author(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }

    public function toDos(): HasMany
    {
        return $this->hasMany(ToDo::class);
    }
}
