There is a main model (Pattern) having many models (Layer ). There is a model (Slayer) that has a polymorphic relationship to the models (Image and Text). The model (Text) has no child relationships, whereas (Image) has a one-to-one relationship to the model (File)
In what way, when unloading the model (Pattern), pull up all (Layer's) each with its own additional relations?
Pattern::whereId($id)->with('layers.layereable')->get();
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire