Giter Club home page Giter Club logo

Comments (5)

mfn avatar mfn commented on May 26, 2024

I can't make out anything in the screenshots, please paste the raw logs (use markdown "tripple-backticks" formatting please)

from laravel-ide-helper.

malejandrosr avatar malejandrosr commented on May 26, 2024

Of course, this is the log that returns:

Exception: No query results for model [App\Models\Role].
Could not analyze class App\Models\User.

Trace:
#0 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/app/Models/User.php(146): Illuminate\Database\Eloquent\Relations\BelongsToMany->firstOrFail()
#1 [internal function]: App\Models\User->abilityRolePermissions()
#2 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(1148): ReflectionMethod->invoke(Object(App\Models\User))
#3 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(595): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->getAttributeTypes(Object(App\Models\User), Object(ReflectionMethod))
#4 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(289): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->getPropertiesFromMethods(Object(App\Models\User))
#5 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(176): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->generateDocs(Array, Array)
#6 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->handle()
#7 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#8 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#9 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#10 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#11 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call(Array)
#12 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#13 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#14 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Barryvdh\LaravelIdeHelper\Console\ModelsCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /Users/alejandrosalgado/Documents/Web/Sites/vue-app/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 {main}

from laravel-ide-helper.

mfn avatar mfn commented on May 26, 2024

What is abilityRolePermissions()? Is User.php(146) part of that method?

I've a feeling this is what causes the problem: in \Barryvdh\LaravelIdeHelper\Console\ModelsCommand::getAttributeTypes we're calling this code:

        // Private/protected ReflectionMethods require setAccessible prior to PHP 8.1
        $reflectionMethod->setAccessible(true);

        /** @var Attribute $attribute */
        $attribute = $reflectionMethod->invoke($model);

from laravel-ide-helper.

malejandrosr avatar malejandrosr commented on May 26, 2024

Yes, it's a mutator/accessor where I obtain the permissions of the user role, for that there I call the role relationship that my User model has, after that I call the permissions() relationship that my Role model has.

from laravel-ide-helper.

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.