Add TenantPropController and requests for managing tenant properties; define API routes for tenant props
This commit is contained in:
28
app/Domains/Tenant/Requests/StoreTenantPropRequest.php
Normal file
28
app/Domains/Tenant/Requests/StoreTenantPropRequest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Tenant\Requests;
|
||||
|
||||
use App\Domains\Prop\Support\PropDataType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreTenantPropRequest 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' => ['required', Rule::enum(PropDataType::class)],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user