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

<?php

namespace App\Http\Requests\Admin\Product;

use Illuminate\Foundation\Http\FormRequest;

use Illuminate\Http\Request;

class ProductGetRequest 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(Request $request)
    {
        return [ 'product_id' => 'required|exists:products,id' ];
    }

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