feat: add category management
associate with entries and text widgets
This commit is contained in:
parent
c83028b4d4
commit
9b9e1a8e29
22 changed files with 392 additions and 46 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class TextWidget extends Model
|
||||
{
|
||||
|
|
@ -13,5 +14,11 @@ class TextWidget extends Model
|
|||
'title',
|
||||
'description',
|
||||
'content',
|
||||
'category_id',
|
||||
];
|
||||
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue