Laravel-ide-helper: Does this not support Redis autocomplete?

Created on 5 May 2016  路  20Comments  路  Source: barryvdh/laravel-ide-helper

Does this not support Redis autocomplete? I tried Cache, it can autocomplete, but not for Redis.

All 20 comments

Gotta give us more info: what kind of autocompletion do you want? Both Redis and Predis are visible within Laravel app, in PhpStorm 10 (due to a Metadata-file related bug, this package can't shine in PS 2016 for the moment, until Jetbrains fixes the issue). I just tested, they work fine, if you have imported them correctly.

For example, when I type Cache::, it will show :

2016-05-05 10 54 03

While when I type Redis:: there is no tips:

2016-05-05 10 54 38

Nope. Check your namespacing. It should be \Redis if you are namespacing:

image

@shehi It does not work:

2016-05-10 5 25 43

Does the Redis class exist in the generate ide_helper file?

@barryvdh No, I searched for it in ide_helper.php, but found nothing.

And does the Predis\Client class exists?

See this check here: https://github.com/barryvdh/laravel-ide-helper/blob/e97ed532f09e290b91ff7713b785ed7ab11d0812/src/Generator.php#L188-L191

Does removing that check help?

@barryvdh No, that file does not contain anything about [Redis] or [Predis]

No I meant in your own application. See the referenced lines.

If I remove that line, it will return

[Symfony\Component\Debug\Exception\FatalThrowableError]  
  Fatal error: Class 'Predis\Client' not found  

Try Invalidating your PhpStorm cache and reindexing. And plz try to provide fullscreen screenshots showing us the version of your PhpStorm - don't really want to waste time here with v2016.

You are not using IDEA IntelliJ with PHP plugins, are you?

@shehi Do you mean this?

2016-05-10 5 58 25

I'm using phpStorm 2106.1

Okkk, please don't :) Revert back to 10.x as we have standing bug in 2016.*. See #340 . I'd say close this issue until it's fixed at Jetbrain's end, but I will let @barryvdh decide that.

But can you use the Redis class at all then? Don't you need the Predis Client installed to be able to use that?
That is why the check is there.

https://laravel.com/docs/5.2/redis

Before using Redis with Laravel, you will need to install the predis/predis package (~1.0) via Composer.

Just to be 100% sure, you did required the predis package?

@barryvdh @shehi Sorry for that, I just missed to install predis/predis. Thanks for helping me.

Instead of importing Redis Like
use Illuminate\Support\Facades\Redis;
import like following
use Redis;

Now you will get auto complete

As @dvikas said that. It works for me.
i change use Illuminate\Support\FacadesRedis;
To
use Redis;
thanks for your help @dvikas

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivansammartino picture ivansammartino  路  3Comments

ghost picture ghost  路  5Comments

GitzJoey picture GitzJoey  路  4Comments

neeravp picture neeravp  路  3Comments

hatamiarash7 picture hatamiarash7  路  3Comments