I haven't found how I can force a model to re-query it`s children.
Model
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Model1 extends Model
{
public function seasons() {
return $this->hasMany('App\Models\Seasons', 'series_id', 'id');
}
}
When I call $instanceModel1->seasons(); throughout my application logic I want an element removed along the way. Is there a way when calling $instanceModel1->seasons(); a second time to force the Eloquent to do a query rather than returning the models already loaded?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire