Open scbing opened 6 years ago
We are open to pull requests
Morphing is a really difficult topic, as the possible Models are unpredictable. But maybe someone finds a way.
I was able to modify the blade templates to accommodate the relationships in relationship-partial.blade.php/ relationship-new-modal.blade.php.
<option value="morphTo" @if(isset($relationshipDetails->type) && $relationshipDetails->type == 'morphTo'){{ 'selected="selected"' }}@endif>Morph To</option>
<option value="morphToMany" @if(isset($relationshipDetails->type) && $relationshipDetails->type == 'morphToMany'){{ 'selected="selected"' }}@endif>Morph To Many</option>
and the javascript to allow input of the pivot table and adding some additional input to accept a "morph_column" which would be used to morphToMany(\Model:class, *morph_column*)
<p class="morph_column"><strong>Morph Column <span class="label_table_name"></span>: </strong>
<span><input type="text" class="form-control" name="morph_column" placeholder="Morph Column" value="{{ $relationshipDetails->morph_column ?? ''}}"></span>
</p>
the problem I am having is that it does not seem to "save" the morph_column in the JSON details
* Laravel Version: 5.6.17 * Voyager Version: 1.0.* * PHP Version: * Database Driver & Version:
Model relation
hasManyThrough morphTo morphMany morphToMany morphedByMany
Each project will basically use the model relationship here.
Is there a support for the plan?
Me Too waiting for morph relationships in voyager.
Model relation
Each project will basically use the model relationship here.
Is there a support for the plan?