Added Item model, resource and its API.

Updated Category model to have Items.
This commit is contained in:
2023-06-14 17:16:50 +03:00
parent b5a264d92f
commit 18bd849827
12 changed files with 350 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?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);
}
}