jeudi 4 mai 2017

Why does not work except in collection Laravel?

I have the following code:

  $object = Object::with("prototypes.fields")->findOrFail($id)->get();

  $object_copied = $object->except(['id', 'prefix', 'prototypes']);

  dd($object_copied->all());

Last line returns collection with fields that should be except: 'id', 'prefix', 'prototypes'



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire