app/Http/Requests/ServiceTypeRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        $serviceType = $this->route('service_type') ? $this->route('service_type')->id : 'NULL';
        return [
            'name' => 'required|unique:service_types,name,' . $serviceType . ',id,user_id,' . Auth::user()->id
        ];
    }
public function rules ( ) { $ serviceType = $ this -> route ( 'service_type' ) ? $ this -> route ( 'service_type' ) -> id : 'NULL' ; return [ 'name' => 'required|unique:service_types,name,' . $ serviceType . ',id,user_id,' . Auth :: user ( ) -> id ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .
//unique:table,column,except,idColumn