app/Http/Requests/ProviderRequest.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()
    {
        $provider = $this->route('provider') ? $this->route('provider')->id : 'NULL';
        return [
            'name'      => 'required|unique:providers,name,' . $provider . ',id,user_id,' . Auth::user()->id,
            'website'   => 'sometimes|nullable|url|max:255',
            'label'     => 'sometimes|max:7',
        ];
    }
public function rules ( ) { $ provider = $ this -> route ( 'provider' ) ? $ this -> route ( 'provider' ) -> id : 'NULL' ; return [ 'name' => 'required|unique:providers,name,' . $ provider . ',id,user_id,' . Auth :: user ( ) -> id , 'website' => 'sometimes|nullable|url|max:255' , 'label' => 'sometimes|max:7' , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .
//unique:table,column,except,idColumn