Add PropController, StorePropRequest, UpdatePropRequest, PropResource, and PropableModels; define API routes for props management

This commit is contained in:
2026-06-22 12:45:23 -03:00
parent 054a3a81eb
commit cde27c0d34
7 changed files with 210 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Domains\Prop\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* @mixin \App\Domains\Prop\Models\Prop
*/
class PropResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'propable_type' => $this->propable_type,
'codigo' => $this->codigo,
'nombre' => $this->nombre,
'is_required' => $this->is_required,
'data_type_id' => $this->data_type_id,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}