<?php

namespace LaraBB\Category\UI\Web\Requests;

use Illuminate\Foundation\Http\FormRequest;
use LaraBB\Application\Traits\Request;

/**
 * Class Show
 * @package LaraBB\Category\UI\Web\Requests
 */
class Show extends FormRequest
{
    use Request;

    /**
     * @return bool
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * @return array
     */
    public function rules(): array
    {
        return $this->getRules('categories.slug');
    }

    /**
     * @return array
     */
    public function messages(): array
    {
        return $this->getMessages('categories.slug');
    }

    /**
     * @param null $keys
     * @return array
     */
    public function all($keys = null): array
    {
        $data         = parent::all($keys);
        $data['slug'] = $this->route('slug');

        return $data;
    }
}
