Viewing File: /home/ubuntu/walnutminds-ecom-backend-base/app/Http/Requests/Admin/Category/CategoryGetRequest.php

<?php

namespace App\Http\Requests\Admin\Category;

use Illuminate\Foundation\Http\FormRequest;

class CategoryGetRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [ 'category_id' => [ 'required', 'exists:categories,id' ] ];
    }

    /**
     * Custom Validation Errors.
     *
     * @return array
     */
    public function messages()
    {
        return ['exists' => tr('category_not_found') ];
    }
}
Back to Directory File Manager