forked from admin/services_core
big update base struktur tahap 1
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\User;
|
||||
|
||||
use App\Enums\UserAccessLevel;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class IndexUserRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
/** Kata kunci untuk mencari nama, username, email, atau nomor WhatsApp. */
|
||||
'search' => ['nullable', 'string', 'max:255'],
|
||||
/** Filter status akun user. */
|
||||
'status' => ['nullable', Rule::in(['active', 'inactive', 'suspended'])],
|
||||
/** Filter level akses user. */
|
||||
'access_level' => ['nullable', Rule::enum(UserAccessLevel::class)],
|
||||
/** Nomor halaman yang ingin diambil. */
|
||||
'page' => ['nullable', 'integer', 'min:1'],
|
||||
/** Jumlah data per halaman, maksimal 100. */
|
||||
'per_page' => ['nullable', 'integer', 'min:1', 'max:100'],
|
||||
/** Kolom pengurutan data. */
|
||||
'sort_by' => ['nullable', Rule::in(['id', 'name', 'username', 'email', 'whatsapp_number', 'access_level', 'status', 'created_at'])],
|
||||
/** Arah pengurutan data. */
|
||||
'sort_direction' => ['nullable', Rule::in(['asc', 'desc'])],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user