Giter Club home page Giter Club logo

Comments (7)

bhulsman avatar bhulsman commented on June 18, 2024 1

@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.

nunomaduro avatar nunomaduro commented on June 18, 2024

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.

szepeviktor avatar szepeviktor commented on June 18, 2024

@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.

brendt avatar brendt commented on June 18, 2024

@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.

brendt avatar brendt commented on June 18, 2024

@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.

tsushant avatar tsushant commented on June 18, 2024

@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.

szepeviktor avatar szepeviktor commented on June 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.