You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using it to generate models' PHPDocs. I need to only include the properties and methods of the class itself, not the ones from the factory companion class and the \Eloquent\Builder query-related methods. Is there a way to do it? I already opted out of almost everything in the config)
which receives $this which is an instance of ModelsCommand and you can call unsetMethod('newModelQuery')
But due to the current behaviour, which I would classify as "bug", it does not work: because unsetMethod performs strtolower() but the names in internal array are not lowered cases.
It would work for methods not having mixed case (like query) but not newModelQuery :/
it does not work: because unsetMethod performs strtolower() but the names in internal array are not lowered cases
Stumbled upon that one too.. Looks like there's already a fix for that - #1441, but it was closed by the creator. Any ideas why and if are there workarounds?
Ok, so anyway I needed it to work so I did the following:
Created my extension of \Barryvdh\LaravelIdeHelper\Console\ModelsCommand:
<?phpnamespaceApp\Support\IdeHelper;
useBarryvdh\LaravelIdeHelper\Console\ModelsCommand;
classModelsCommandCustomextendsModelsCommand
{
publicfunctionunsetMethod($name)
{
unset($this->methods[$name]); // new one
unset($this->methods[strtolower($name)]); // original one
}
}
In the AppServiceProvider have added this to the register method:
$this->app->singleton(
'command.ide-helper.models',
function ($app) {
returnnewModelsCommandCustom($app['files']);
}
);
Now Laravel's App/Container uses my "implementation" of ModelsCommand, so the following works fine:
$command->unsetMethod('myCamelCaseMethod'); // this now works
Versions:
Question:
Good day and thanks for the great tool!
I am using it to generate models' PHPDocs. I need to only include the properties and methods of the class itself, not the ones from the factory companion class and the
\Eloquent\Builder
query-related methods. Is there a way to do it? I already opted out of almost everything in the config)I need this
but not this
The text was updated successfully, but these errors were encountered: