File "UpdateAttributeOptionRequest.php"

Full Path: /home/clickysoft/public_html/jmapi5.clickysoft.net/app/Http/Requests/Admin/UpdateAttributeOptionRequest.php
File size: 678 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace App\Http\Requests\Admin;

use Gate;
use Illuminate\Foundation\Http\FormRequest;

class UpdateAttributeOptionRequest extends FormRequest
{
    public function authorize()
    {
        return Gate::allows('attribute_option_edit');
    }

    public function rules()
    {
        return [
            'attribute_id' => [
                'required',
                'integer',
                'exists:attributes,id',
            ],
            'name' => [
                'string',
                'max:50',
                'required',
                'unique:attribute_options,name,' . request()->route('attribute_option')->id,
            ],
        ];
    }
}