beyondcode / beyondcode/invoker-community
can't find method on model that contains underscore
- Dominant language
- No language data
- Stars
- 76
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
------
**OS**: darwin
**Invoker Version**: 2.0.2
**Laravel Version**: 8.22.1
**Local project**: true
**PHP Binary**: /usr/local/bin/php
**Route**: /project/index?class=App%5CUser&time=1612386170472&project=local-4Ep3udexmFQ5tkqPLfdxkS
**Error**:
```
BadMethodCallException
Call to undefined method App\User::curaReports()
at /Users/aaronkenton/websites/numinous/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50
46▕ * @throws \BadMethodCallException
47▕ */
48▕ protected static function throwBadMethodCallException($method)
49▕ {
➜ 50▕ throw new BadMethodCallException(sprintf(
51▕ 'Call to undefined method %s::%s()', static::class, $method
52▕ ));
53▕ }
54▕ }
• Bad Method Call: Did you mean App\User::cura_reports() ?
[2m+7 vendor frames [22m
8 phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/Actions/IndexResourceAction.php:129
Illuminate\Database\Eloquent\Builder::withCount()
9 phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/Actions/IndexResourceAction.php:51
_HumbugBoxe923e1c0def2\Invoker\Actions\IndexResourceAction::addWithCount()
```
In my user model the relationship is set up using this method:
```
public function cura_reports()
{
return $this->hasMany(\App\Models\Cura\Reports::class);
}
```
I am getting similar errors like the one above on other relationships.
Is it throwing an error because of the underscore in the method name? I am using underscore because it allows me to seperate similar relationships for different domains in a multi tenancy app.
What would you suggest?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.