Add PropController, StorePropRequest, UpdatePropRequest, PropResource, and PropableModels; define API routes for props management
This commit is contained in:
27
app/Domains/Prop/Requests/StorePropRequest.php
Normal file
27
app/Domains/Prop/Requests/StorePropRequest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Prop\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StorePropRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'codigo' => ['required', 'string', 'max:255', Rule::unique('props', 'codigo')],
|
||||
'nombre' => ['required', 'string', 'max:255'],
|
||||
'is_required' => ['sometimes', 'boolean'],
|
||||
'data_type_id' => ['required', 'integer', 'exists:props_data_types,id'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user