PostSlugValidationRequest.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Kirki\App\Http\Requests\Post; |
| 4 | |
| 5 | use Kirki\Framework\Http\Request; |
| 6 | use Kirki\Framework\Sanitizer; |
| 7 | |
| 8 | class PostSlugValidationRequest extends Request |
| 9 | { |
| 10 | /** |
| 11 | * Validation rules. |
| 12 | */ |
| 13 | public function rules() |
| 14 | { |
| 15 | return [ |
| 16 | 'post_id' => 'nullable|integer', |
| 17 | 'post_type' => 'required|string', |
| 18 | 'post_name' => 'required|string', |
| 19 | ]; |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Sanitization filters. |
| 24 | */ |
| 25 | public function filters() |
| 26 | { |
| 27 | return [ |
| 28 | 'post_id' => Sanitizer::INT, |
| 29 | 'post_type' => Sanitizer::TEXT, |
| 30 | 'post_name' => Sanitizer::TEXT, |
| 31 | ]; |
| 32 | } |
| 33 | } |
| 34 |