2024-01-29 08:53:46 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Api\v1\Requests;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
|
2024-03-14 15:09:05 +01:00
|
|
|
class UserManagerPromoteRequest extends FormRequest
|
2024-01-29 08:53:46 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize()
|
|
|
|
{
|
|
|
|
return Auth::user()->isAdministrator();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'is_admin' => 'required|boolean',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|