add all controllers logic
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Staff;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class StaffIndexRequest extends ApiFormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'page' => ['nullable', 'integer', 'min:1'],
|
||||
'per_page' => ['nullable', 'integer', 'min:1', 'max:100'],
|
||||
'role' => ['nullable', 'string', 'max:100'],
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'semester' => ['nullable', 'string', 'max:20'],
|
||||
'sort_by' => ['nullable', 'in:created_at,lastname,firstname'],
|
||||
'sort_dir' => ['nullable', 'in:asc,desc'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Staff;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class StaffStoreRequest extends ApiFormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => ['nullable', 'integer', 'min:1'],
|
||||
'firstname' => ['required', 'string', 'max:100'],
|
||||
'lastname' => ['required', 'string', 'max:100'],
|
||||
'email' => ['required', 'email', 'max:150'],
|
||||
'phone' => ['nullable', 'string', 'max:20'],
|
||||
'role_name' => ['required', 'string', 'max:100'],
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'status' => ['nullable', 'string', 'max:40'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Staff;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class StaffUpdateRequest extends ApiFormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'firstname' => ['nullable', 'string', 'max:100'],
|
||||
'lastname' => ['nullable', 'string', 'max:100'],
|
||||
'email' => ['nullable', 'email', 'max:150'],
|
||||
'phone' => ['nullable', 'string', 'max:20'],
|
||||
'role_name' => ['nullable', 'string', 'max:100'],
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'status' => ['nullable', 'string', 'max:40'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user