The element $this->film->model changes from a instance of Film model to an instance of Illuminate\Database\Eloquent\Builder, this in turns makes it impossible to call the RepositoryInterface functions such as in:
foreach( $filmsToDelete as $f) {
$this->film->delete($f->id);
}
This fails with Call to undefined method Illuminate\Database\Query\Builder::destroy() as the Repository.php calls $this->model->destroy($id); on line 126, but since the model is not a model anymore it fails.
Is this the expected behaviour or am I doing something wrong?
Hey there,
Thanks for your awesome library, I have a question, hopefully not a bug, I am probably not using it right....
Using your example in the README, in the
FilmsController
, after you perform a search such as:The element
$this->film->model
changes from a instance ofFilm
model to an instance ofIlluminate\Database\Eloquent\Builder
, this in turns makes it impossible to call theRepositoryInterface
functions such as in:This fails with
Call to undefined method Illuminate\Database\Query\Builder::destroy()
as theRepository.php
calls$this->model->destroy($id);
on line 126, but since themodel
is not a model anymore it fails.Is this the expected behaviour or am I doing something wrong?
Thanks. /S