GithubHelp home page GithubHelp logo

Comments (15)

windbridges avatar windbridges commented on June 30, 2024 11

Hi, I found this thread by googling "Class 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class' not found". It was my real problem which I was unable to solve. I checked my composer.json file twice, it was ok, but error still occured. Right before uninstalling this package I decided to try to remove "::class" from provider definition in app.php. And it works!

Documentation says:

After updating composer, add the service provider to the providers array in config/app.php
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,

And it didn't work for me. When I replaced it to

Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider

it works fine. And IDE recognizes all classes correctly now.
I hope it helps to somebody with similar problem.

from laravel-ide-helper.

chaerf avatar chaerf commented on June 30, 2024 6

my case had APP_ENV=prod instead of APP_ENV=production

from laravel-ide-helper.

samhk222 avatar samhk222 commented on June 30, 2024 5

In my case was because the package was in require-dev and in my AppServiceProvider i had

if ($this->app->isLocal()) { $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); }

And in composer.json i had

"post-update-cmd": [ "Illuminate\\Foundation\\ComposerScripts::postUpdate", "@php artisan ide-helper:generate", "@php artisan ide-helper:meta" ]

So when i run any deploy, the post-update-cmd was triggering, and raising a error

from laravel-ide-helper.

pneal-vital avatar pneal-vital commented on June 30, 2024 1

zahraMHD

Class 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider' is used to enable PHPStorm to find classes. When you have “use \Request;” in your php file, PHPStorm cannot find the source file this refers to. Google/search Laravel Ide Helper in github and you will see how 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider' can be used.

Before you try to deploy your code, comment out 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider' in composer.json.

Hope this helps

Paul

From: zahraMHD [mailto:[email protected]]
Sent: June-08-16 6:28 PM
To: barryvdh/laravel-ide-helper
Cc: Paul Neal; Comment
Subject: Re: [barryvdh/laravel-ide-helper] Class 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider' not found (#55)

I have this problem I update my composer.json and add Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, in my app.php in providers array but when run php artisan ide-helper:generate command I got this error " Class 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider' not found " is any thing that I did not check?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #55 (comment) , or mute the thread https://github.com/notifications/unsubscribe/AJApOE4dEwz0uRTmd8YS1IUn2cuwitV7ks5qJ0HVgaJpZM4Be-Y_ . https://github.com/notifications/beacon/AJApOLHak1Jl_LBwyg7gx25HdwsS7Frhks5qJ0HVgaJpZM4Be-Y_.gif

from laravel-ide-helper.

barryvdh avatar barryvdh commented on June 30, 2024

Did you add it to composer.json and have you run composer update? Do you have a folder vendor/barryvdh/laravel-ide-helper?

from laravel-ide-helper.

sulfo avatar sulfo commented on June 30, 2024

Yes, I added "barryvdh/laravel-ide-helper": "1.*" into my composer.json.

{
    "require": {
        "monolog/monolog": "1.2.*",
        "barryvdh/laravel-ide-helper": "1.*"
    }
}

I've not run the composer update yet. Here's the output from it:

php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing doctrine/collections (v1.1)
  - Installing doctrine/collections (v1.2)
    Downloading: 100%         

  - Removing illuminate/console (v4.1.20)
  - Installing illuminate/console (v4.1.21)
    Loading from cache

  - Removing illuminate/support (v4.1.20)
  - Installing illuminate/support (v4.1.21)
    Loading from cache

  - Removing illuminate/filesystem (v4.1.20)
  - Installing illuminate/filesystem (v4.1.21)
    Loading from cache

Writing lock file
Generating autoload files

Yes, I have a folder in the root of all my project with that location (where composer also have a vendor folder i guess).
Location: Sites/laravel/vendor/barryvdh/laravel-ide-helper

There is not any folders named it in my laravel project vendor folder:
Location: Sites/laravel/todo/vendor

Not sure if this is the problem or not.

from laravel-ide-helper.

barryvdh avatar barryvdh commented on June 30, 2024

I'm not 100% clear, is that you entire composer.json file? Where is the laravel/laravel line etc?

from laravel-ide-helper.

sulfo avatar sulfo commented on June 30, 2024

It was my composer.json with in the same folder as composer.phar I posted. Not the one in my project. The one in the project looks like this:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.1.*",
        "barryvdh/laravel-ide-helper": "1.*"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

I found this, and it help me to update the project: http://stackoverflow.com/questions/17564641/composer-phar-and-json-file-locations-symfony2

My problem was that I only updated the vendor folder with composer.phar (one folder out from the project root) and not the project. http://stackoverflow.com/questions/17564641/composer-phar-and-json-file-locations-symfony2

Here is the new output from the update:

michael$ php composer.phar --working-dir=todo/ update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing patchwork/utf8 (v1.1.17)
  - Installing patchwork/utf8 (v1.1.18)
    Loading from cache

  - Installing doctrine/lexer (v1.0)
    Loading from cache

  - Installing doctrine/annotations (v1.1.2)
    Loading from cache

  - Installing doctrine/collections (v1.2)
    Loading from cache

  - Installing doctrine/cache (v1.3.0)
    Loading from cache

  - Installing doctrine/inflector (v1.0)
    Loading from cache

  - Installing doctrine/common (v2.4.1)
    Loading from cache

  - Installing doctrine/dbal (v2.4.2)
    Loading from cache

  - Installing symfony/class-loader (v2.4.1)
    Loading from cache

  - Installing dflydev/markdown (v1.0.3)
    Loading from cache

  - Installing phpdocumentor/reflection-docblock (2.0.0)
    Loading from cache

  - Removing laravel/framework (v4.1.18)
  - Installing laravel/framework (v4.1.21)
    Loading from cache

  - Installing barryvdh/laravel-ide-helper (v1.8.1)
    Loading from cache

Writing lock file
Generating autoload files
Generating optimized class loader

Thanks for getting me on the right track.

from laravel-ide-helper.

pietdevries94 avatar pietdevries94 commented on June 30, 2024

Did you put quotes around Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class? That would break it.

from laravel-ide-helper.

windbridges avatar windbridges commented on June 30, 2024

Hmm, I didn't even thought that it may work without quotes, so I wrapped it without hesitation. Thank you for hint.

from laravel-ide-helper.

pietdevries94 avatar pietdevries94 commented on June 30, 2024

::class is a Scope Resolution Operator. http://php.net/manual/en/language.oop5.paamayim-nekudotayim.php It returns the class which returns the same string as the quoted part.

from laravel-ide-helper.

windbridges avatar windbridges commented on June 30, 2024

Yes, I know about ::, but combination with class keyword confuses me.

from laravel-ide-helper.

pneal-vital avatar pneal-vital commented on June 30, 2024

Well done, thanks guys

from laravel-ide-helper.

zahraMHD avatar zahraMHD commented on June 30, 2024

I have this problem I update my composer.json and add Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, in my app.php in providers array but when run php artisan ide-helper:generate command I got this error " Class 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider' not found " is any thing that I did not check?

from laravel-ide-helper.

karyubi avatar karyubi commented on June 30, 2024

Hi, I am new in Laravel. I am using Netbeans 10 on Windows 10 and xampp. I dont have a folder vendor/barryvdh/laravel-ide-helper, from where could I download it or ...

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.