Files
dots-bot-api/app/Models/Item.php
T
KKlochko 18bd849827 Added Item model, resource and its API.
Updated Category model to have Items.
2023-06-14 17:16:50 +03:00

27 lines
474 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Item extends Model
{
use HasFactory;
protected $fillable = [
'uuid',
'name',
'url',
'description',
'price',
'image',
];
public function category(): BelongsTo
{
return $this->belongsTo(Category::class);
}
}