Preview: EventRequest.php
Size: 1.05 KB
/var/www/multi-event-cfp.bitkit.dk/httpdocs/app/Http/Requests/EventRequest.php
<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Routing\Redirector;
class EventRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(): array
{
return [
'event_name' => 'required|string',
'year' => 'required|integer',
'slug_name' => 'required|string|unique:events',
'edition_ids' => 'nullable|string',
'division' => 'required|string',
'admins' => 'required|array'
];
}
protected function failedValidation(Validator $validator)
{
validationErrorResponse($validator->errors());
}
}
Directory Contents
Dirs: 0 × Files: 1