24 lines
369 B
PHP
24 lines
369 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Category;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class Product extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $guarded = ['id'];
|
|
protected $table = 'products';
|
|
|
|
public function category()
|
|
{
|
|
return $this->belongsTo(Category::class);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|