crate service and request for create user
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\UserManagement;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ChangeConfirmEnabelRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
return $user->hasPermissionTo('full-user-management') ||
|
||||
($user->hasPermissionTo('limited-user-management') && $this->province_id == $user->province_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'enabled' => 'required|in:0,1',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user