Added Category model, resource and its API.

Updated Company model to have Categories.
This commit is contained in:
2023-06-14 16:58:35 +03:00
parent 505fa2e831
commit b5a264d92f
12 changed files with 341 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Category extends Model
{
use HasFactory;
protected $fillable = [
'uuid',
'name',
'url',
];
public function company(): BelongsTo
{
return $this->belongsTo(Company::class);
}
}