| 1 | <?php |
||
| 8 | class EloquentRepository extends RepositoryAbstract implements Repository |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Get all published navigation. |
||
| 12 | * |
||
| 13 | * @return \Illuminate\Database\Eloquent\Collection|static[] |
||
| 14 | */ |
||
| 15 | public function getPublished() |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Get repository model. |
||
| 26 | * |
||
| 27 | * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder |
||
| 28 | */ |
||
| 29 | public function getModel() |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Find or fail a navigation. |
||
| 36 | * |
||
| 37 | * @param int $id |
||
| 38 | * @return \Yajra\CMS\Entities\Navigation |
||
| 39 | */ |
||
| 40 | public function findOrFail($id) |
||
| 44 | } |
||
| 45 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: