laravel-streams / streams-core

Streams is an open-source web application engine for Laravel.
https://streams.dev
Other
169 stars 99 forks source link

EloquentAdapter::make() and EloquentAdapter::newInstance() returns an Model instance #736

Closed BubeCPH closed 1 year ago

BubeCPH commented 2 years ago

\Streams\Core\Criteria\Adapter\EloquentAdapter::make() and EloquentAdapter::newInstance() returns a Model instance instead of an EntryInterface instance.

Therefore I get exceptions like this one: Streams\Core\Criteria\Adapter\EloquentAdapter::make(): Return value must be of type Streams\Core\Entry\Contract\EntryInterface, App\Models\TransmissionType returned

BubeCPH commented 2 years ago

If I have missed something, catch me on Discord

BubeCPH commented 2 years ago

A solution could be: Remove model creation in newInstance() and return newInstance in make() in the file src/Criteria/Adapter/EloquentAdapter.php

RyanThompson commented 1 year ago

The model, with Streams, carries the entry interface now.