jeudi 31 mars 2016

Laravel 5 isDirty() always returns false

I want to check if the model has been changed with isDirty method, but always returns false.

This is my code :

 if (!is_null($partnersData)) {
        foreach ($partnersData as $partnerData) {
            $partner = Partner::find($partnerData['partner_id']);
            $partner->update($partnerData);

            if($partner->isDirty()){
                dd('true');
            }
        }
    }



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

Aucun commentaire:

Enregistrer un commentaire