Add ProductController and Producto model with CRUD operations and migration

This commit is contained in:
2026-06-18 10:13:03 -03:00
parent 02ebe0f0ca
commit aa49c82543
4 changed files with 134 additions and 0 deletions

31
app/Models/Producto.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
#[Fillable([
'tenant_id',
'categoria_id',
'slug',
'nombre',
'descripcion',
'precio',
])]
class Producto extends Model
{
use HasFactory;
protected $table = 'productos';
protected function casts(): array
{
return [
'tenant_id' => 'integer',
'categoria_id' => 'integer',
'precio' => 'decimal:2',
];
}
}