fanatic/app/Http/Requests/StoreOwnedRequest.php
2022-04-28 12:01:17 -07:00

39 lines
1.1 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreOwnedRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return $this->user()->can('create', Joined::class);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'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'],
'opened' => ['nullable', 'date'],
'hold_member_updates' => ['nullable', 'boolean'],
];
}
}