Laravel-ide-helper: Support for Laravel 5.4

Created on 23 Jan 2017  ·  35Comments  ·  Source: barryvdh/laravel-ide-helper

Hi,

could you already tag a L5.4 compatible release like you've done with debugbar?

Most helpful comment

I'm having this error, with any version: Call to undefined method Illuminate\Foundation\Application::share()

All 35 comments

Did you test the latest ^2@dev version with the current 5.4? Is this good to tag?

Tagged v2.2.3, let me know if you run into problems!

Cool, thanks!

I'm having this error, with any version: Call to undefined method Illuminate\Foundation\Application::share()

Ah we should replace those with singleton (see upgrade docs)
Can you submit a PR for the service provider?

Sure, I will do, thanks

Actually, I think this should already be fixed and tagged. Are you sure you have the latest version?

how to install in L5.4?
just need to copy https://gist.githubusercontent.com/barryvdh/5227822/raw/e559691e54eb0a5da95d98188d1fa3a27fbfa535/_ide_helper.php ? but I still got facade error.

https://github.com/barryvdh/laravel-ide-helper#install

I'll regenerate the gist when I have the time for L5.4

laravel-ide-helpers doesn't seem to work at all for me with L5.4, I've tried regenerating multiple times, did anyone get it to work? Also the file is full of errors (1100~ Non-static method 'sendLaterOn' should not be called statically). Thanks

What doesn't work? Cause you do get a file?
Some Php storm linting errors cannot be avoided, but shouldn't impact the functionality

image

I do see this function in the generated file

Don't import the facade, then it won't work indeed.

I'm not sure what you mean, sorry, thanks for the fast response btw 👍

You're referencing the full path, while for it to work, just use the facade in the global namespace. Eg. Remove the use..

Will a new version come out to suport real-time Facades as shown here? https://laracasts.com/series/whats-new-in-laravel-5-4/episodes/8

No

Hello, I have the same kind of problem, what should I replace

use Illuminate\Support\Facades\Validator;

with ?

If I replace 'use' with 'namespace' it creates other problems.

Example: https://i.stack.imgur.com/CuzwM.png

@barryvdh thanks that helped

@Brakkar what I did to fix it is instead of use Illuminate\Support\Facades\Validator; only use the Facade like use Validator; , be sure that you do include the facade in the aliases of config/app.php

@thoys Thannks, indeed, this solves the issue. Seems the alias was set already in config/app.php.

@TheDeadCode I discovered this feature today. I will make some tests but in all case I think you will need to specify your facades in config...

@Brakkar this PR #437 solves your issue with fullpaths

@barryvdh Just spun up a new Laravel 5.4 app, generated _ide_helper.php, code-assist for Eloquent models aren't working as previously for my Laravel 5.3 app.

E.g. User::find(1)-> //doesn't show any code-assist

I compared the _ide_helper.php generated for the find method. Screenshots as follows.

Laravel 5.3 - This has correct code-assist.
image

Laravel 5.4 - This doesn't have the code-assist.
image

I'm guessing code-assist is broken for 5.4 due to the @return PHPDoc tag not specifying the correct return types.

Get this error running ide-helper:^2@dev and laravel 5.4.

php artisan ide-helper:models

PHP Fatal error: Class name must be a valid object or a string in vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php on line 487

[Symfony\Component\Debug\Exception\FatalErrorException]
Class name must be a valid object or a string

Hi,
I'm upgrading a L5.1 app with the packadge "toin0u/geocoder-laravel": "^1.0"

I use a fresh new Lavel 5.4.

1) add "toin0u/geocoder-laravel": "^1.0" in composer.json
2) composer update (OK....)
3) add Geocoder\Laravel\Providers\GeocoderService::class in app.php
4) composer update => error in Barryvdh ide-helper

post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan ide-helper:generate",           **=> error during this step**
            "php artisan ide-helper:meta",
            "php artisan optimize"
        ]

```javascript
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

Illuminate\Foundation\ComposerScripts::postUpdate
php artisan ide-helper:generate
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Geocoder\HttpAdapter\CurlHttpAdapter' not found
Script php artisan ide-helper:generate handling the post-update-cmd event returned with error code 1

Last point, composer update works well if I remove the ide-helper steps in composer.json
```javascript 
"post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]

What do you think ?
Is it coming from Geocoder (maybe not validated with L5.4?) or does this comes from barryvdh/ide-helper ?

Thanks in advance,
Paguemaou

@paguemaou This class exists only in version 2.x of Geocoder. (https://github.com/geocoder-php/Geocoder) What is your version ?

@zedentox

I use this version :

"toin0u/geocoder-laravel": "^1.0",

I think that the Geocoder's class is called from the package composer.json file.

{
    "name": "toin0u/geocoder-laravel",
    "description": "Geocoder Service Provider for Laravel",
    "keywords": [
        "laravel",
        "geocoder",
        "geocoding"
    ],
    "homepage": "http://geocoder-php.org/",
    "license": "MIT",
    "authors": [
        {
            "name": "Antoine Corcy",
            "email": "[email protected]",
            "homepage": "http://sbin.dk",
            "role": "Developer"
        },
        {
            "name": "Mike Bronner",
            "email": "[email protected]",
            "homepage": "https://genealabs.com",
            "role": "developer"
        }
    ],
    "require": {
        "php": ">=5.4",
        "illuminate/support": "~5.0",
        "willdurand/geocoder": "~3.3"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*",
        "doctrine/dbal": "^2.5",
        "laravel/laravel": "^5.3",
        "phploc/phploc": "^3.0",
        "squizlabs/php_codesniffer": "^2.7",
        "phpmd/phpmd": "^2.4",
        "pdepend/pdepend": "^2.2",
        "sebastian/phpcpd": "^2.0",
        "jakub-onderka/php-parallel-lint": "^0.9.2"
    },
    "autoload": {
        "psr-4": {
            "Geocoder\\Laravel\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\": "vendor/laravel/laravel/app/",
            "Geocoder\\Laravel\\Tests\\": "tests/"
        }
    },
    "extra": {
        "branch-alias": {
            "dev-master": "1.0.0-dev"
        }
    }
}

Thanks for your reply
Paguemaou

@paguemaou Your problem is not related to laravel-ide-helper. I continue the conversation here https://github.com/geocoder-php/GeocoderLaravel/issues/66.

@saifulss

https://github.com/laravel/framework/pull/18625

Should be back soon!!

For Laravel 5.4 in manual better use "doctrine/dbal": "~2.3 < 2.6", because dbal 2.6 requiers php ^7.1

UPD: sorry, cli was configured with wrong php version (was 7.1, but not 5.6)

If you're on php7.0 it should skip those version automatically.

Hello @barryvdh,

Since i migrated from laravel 5.2 to laravel 5.4 the command :
php -cli artisan ide-helper:models -W

output this error :
[Symfony\Component\Debug\Exception\FatalErrorException]
Trait 'Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers' not found

In composer.json i have :
"require-dev" : {
"barryvdh/laravel-ide-helper": "^2.4",

Whats wrong ?

Tanhks in advance for response.

Make sure you have the class, and then run composer dump

On 13.11.2017 11:21, ratm54 wrote:
>

Hello @barryvdh https://github.com/barryvdh,

Since i migrated from laravel 5.2 to laravel 5.4 the command :
php -cli artisan ide-helper:models -W

output this error :
[Symfony\Component\Debug\Exception\FatalErrorException]
Trait 'Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers' not
found

In composer.json i have :
"require-dev" : {
"barryvdh/laravel-ide-helper": "^2.4",

Whats wrong ?

Tanhks in advance for response.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/barryvdh/laravel-ide-helper/issues/431#issuecomment-343874871,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAn5AZeH5iR0CyBEnIwgA7h94dZrQKWvks5s2BghgaJpZM4Lqyp1.

Problem is solved.
I have remove reference to AuthenticatesAndRegistersUsers in file App\Http\Controllers\Auth\AuthController.php.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lambik picture Lambik  ·  5Comments

Gummibeer picture Gummibeer  ·  3Comments

beniaminorossini picture beniaminorossini  ·  5Comments

Newbie012 picture Newbie012  ·  4Comments

GitzJoey picture GitzJoey  ·  4Comments