Is it possible to change the data hasMany() and other relationship functions in Laravel return in the same function where you're calling the relationship?
The problem is that in order for all of it to work you need to return the relationship, and returning anything automatically ends the function.
Example:
function problems() { return $this->belongsTo('App\Problem'); // the function ends at this line $this->problem = $this->problems->name; // so this one never executes }
Sorry for typing the code as text, but this is my first question ever.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire