pedi3/app/Models/Categoria.php

27 lines
484 B
PHP
Raw Normal View History

2024-03-12 17:04:59 -03:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Categoria extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
];
/**
* Los productos que pertenecen a la categoría.
*/
public function productos(): HasMany
{
return $this->hasMany(Producto::class);
}
}