© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
8 replies
Lara Zeus

[phpStan] Illuminate\Database\Eloquent\Model::$id.

getting the error on phpstan
level 2 only which drive me crazy!!!!
the code is from


public function canAccessTenant(Model $tenant): bool
{
    return $this->belongsToCompany($tenant);
}
public function canAccessTenant(Model $tenant): bool
{
    return $this->belongsToCompany($tenant);
}

and I cant change the signiter of the function
and adding
Company|Model
Company|Model

wont help!

should phpstan with larastan recognize the default laravel model attributes like id?

includes:
    - vendor/larastan/larastan/extension.neon

parameters:

    paths:
        - app/

    # Level 9 is the highest level
    #level: 7
    level: 2

#    ignoreErrors:
#        - '#PHPDoc tag @var#'
#
#    excludePaths:
#        - ./*/*/FileToBeExcluded.php
#
#    checkMissingIterableValueType: false
includes:
    - vendor/larastan/larastan/extension.neon

parameters:

    paths:
        - app/

    # Level 9 is the highest level
    #level: 7
    level: 2

#    ignoreErrors:
#        - '#PHPDoc tag @var#'
#
#    excludePaths:
#        - ./*/*/FileToBeExcluded.php
#
#    checkMissingIterableValueType: false
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Target [Illuminate\Database\Eloquent\Model] is not instantiable
FilamentFFilament / ❓┊help
2y ago
Target [Illuminate\Database\Eloquent\Model] is not instantiable.
FilamentFFilament / ❓┊help
3y ago
Target [Illuminate\Database\Eloquent\Model] is not instantiable.
FilamentFFilament / ❓┊help
3y ago
Target [Illuminate\Database\Eloquent\Model] is not instantiable.
FilamentFFilament / ❓┊help
3y ago