Comments (7)
@nunomaduro Something might still be causing an issue here:
$member = Member::where(/* some condition */)->firstOrFail();
$contact = $member->contacts()->create(/* some data */);
Yields the following error: "Call to an undefined method Illuminate\Database\Eloquent\Model::contacts()."
Changing firstOrFail
to first
solves the error.
from larastan.
Everything is fixable
@brendt Thanks again for reporting this false positive. π
This issue got fixed on the version v0.1.8
. Do you mind of performing a composer update nunomaduro/larastan
and test it again?
from larastan.
@nunomaduro While running v0.1.8
with --level=2
I've got this:
/**
* Filter only the trashed exhibitions.
*
* @param bool|string $value
* @return \Illuminate\Database\Eloquent\Builder
*/
public function trashed($value = false)
{
return $value == 'true' ? $this->builder->onlyTrashed() : $this->builder;
}
Call to an undefined method Illuminate\Database\Eloquent\Builder::onlyTrashed().
$this->builder
is an \Illuminate\Database\Eloquent\Builder
.
from larastan.
@nunomaduro , it seems fixed! I had to mark 0.2.0@dev
though, only 0.1.5
and below were seen by composer as "stable".
from larastan.
@nunomaduro Do you, by any chance; have an idea if this is also fixable in PHPStorm? It works with PHPStan now, but PHPStorm also shows the error. I know this is not related to this package, but maybe you have an idea?
from larastan.
@nunomaduro Running 0.5.2 with --level=5. I am still getting this for a local scope:
Call to an undefined method Illuminate\Database\Eloquent\Builder::search()
public function scopeSearch($query, $search)
{
if ($search) {
return $query->where('name', 'like', '%'.$search.'%');
}
return $query;
}
$this->model->search(request('search'))->paginate();
from larastan.
@tsushant Thank you for your report.
Please try opening a new issue :) waking up a 2 year old one makes us react slower.
from larastan.
Related Issues (20)
- How to fix phpstan error with models defined in interface ? HOT 1
- Support Livewire? HOT 1
- Error in second step of documentation? HOT 1
- Unable to find Builder Mixin method on Relation HOT 1
- Can I hide Cannot access property error when refering dynamic model field ? HOT 6
- support for subquery ordering
- Two dozen PR-s were closed by deleting the master branch HOT 4
- Internal error when a model has a legacy factory via legacy factories package and a regular factory
- Getting error "Class self was not found while trying to analyse it" HOT 1
- Eloquent Collection `groupBy` has incorrect return type when grouping by multiple fields
- Model::where()->firstOrFail() has unspecific return type HOT 4
- When I tried to build the environment according to the Contribute Guide, an error was output at the point where the test was executed. HOT 2
- Exception in CollectionFilterDynamicReturnTypeExtension HOT 4
- SoftDeletes "createOrRestore" macro not recognised HOT 3
- Attributes cast as Collections incorrectly interpreted as non-nullable HOT 4
- Find missing translation strings in blade files HOT 5
- `ModelPropertyRule` rule do not support methods such as: select(), find(), first() HOT 3
- Infinite recursion until phpstan runs out of memory HOT 3
- [Feature] Detect appended accessors
- Support firstWhere on a collection HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from larastan.