fanatic/app/Http/Requests/StoreOwnedRequest.php

40 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
2022-04-27 21:15:01 -07:00
use Illuminate\Validation\Rule;
class StoreOwnedRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
2022-04-27 21:15:01 -07:00
return $this->user()->can('create', Joined::class);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
2022-04-27 21:15:01 -07:00
'categories' => ['required', 'array'],
'categories.*' => ['numeric', 'exists:categories,id'],
'subject' => ['required', 'string'],
'status' => ['required', 'string', Rule::in(['current', 'upcoming'])],
'slug' => ['required', 'alpha_dash'],
'title' => ['nullable', 'string'],
'image' => ['nullable', 'image'],
2022-04-28 12:01:17 -07:00
'opened' => ['nullable', 'date'],
2022-04-27 21:15:01 -07:00
'hold_member_updates' => ['nullable', 'boolean'],
];
}
}