<?php

namespace Mehrab\Service\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Mehrab\City\Repositories\CityRepo;
use Mehrab\RolePermission\Repositories\RoleRepo;
use Spatie\Permission\Models\Role;

class service_update_parent_request 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()
    {

        $id = intval(request()->update_parent);
        return [
            'delPic' => ['nullable',Rule::in(['on'])],
            'name_parent' => ['required','string','min:2','max:1000'],
            'slug_parent' => ['required','string','min:2','max:1000',Rule::unique('services','slug')->ignore($id)],
            'title_parent' => ['nullable','string','min:2','max:1000'],
            'priority_parent' => ['nullable','numeric'],
            'img_parent' => ['nullable','mimes:jpg,jpeg','image','max:1024']
        ];
    }
}
