Files
athenahr/app/Http/Requests/DenyInviteRequest.php

36 lines
842 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
use App\Facades\Options;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Foundation\Http\FormRequest;
class DenyInviteRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return !Options::getOption('enable_registrations');
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
protected function failedAuthorization()
{
throw new AuthorizationException(__('Sign ups are open; you can\'t modify invites until you close them.'));
}
}