blog/app/Http/Requests/PostRequest.php

25 lines
516 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class PostRequest extends FormRequest
{
public function rules(): array
{
return [
'title' => ['required', 'string', 'max:255'],
'content' => ['required'],
'location' => ['nullable'],
'files' => ['nullable', 'mimes:jpg,jpeg,png', 'max:20000'],
'tags' => ['nullable'],
];
}
public function authorize(): bool
{
return true;
}
}