first work on To Do Lists
This commit is contained in:
1 parent
c71f3ca4d8
commit
c6b94aa1f1
17 files changed
+710
-2
No files matched your search
@@ -0,0 +1,28 @@
|
||||
<?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 users(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function toDos(): HasMany
|
||||
{
|
||||
return $this->hasMany(ToDo::class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user