pedi3/app/Models/Categoria.php

27 lines
486 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 = [
2024-07-03 19:23:00 -03:00
'nombre',
2024-03-12 17:04:59 -03:00
];
/**
* Los productos que pertenecen a la categoría.
*/
public function productos(): HasMany
{
return $this->hasMany(Producto::class);
}
}