lundi 23 mai 2016

Laravel update with unique validation rule not working

I am trying to update my data with a unique rule. I am using

    public function update(Request $request,$slug)
    {
        $find=Info::where('slug',$slug)->first();

        $validator=Validator::make($request->all(),[

            'name'=>'required|min:3|unique:infos,'. $find->id .'',
            'location'=>'required',
            'description'=>'required|min:10'


        ]);

}

But its return an error

SQLSTATE[42S22]: Column not found: 1054 Unknown column '1' in 'where clause' (SQL: select count(*) as aggregate from `infos` where `1` = fsdfds)

I cant understand whats wrong going here.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1WeD7aU
via IFTTT

Aucun commentaire:

Enregistrer un commentaire