how to find the "::get" in php or its framwork?

86 Views Asked by At

I can not understand the ::get in thinkphp and laravel ,I can find the Session::get or the self::get .So Is the ::get is the function? I use the phpstorm but I can not find the definition of that . it is the meaning of "::get" but not the symbol of "::"

1

There are 1 best solutions below

3
On BEST ANSWER

You'll have to educate yourself on Laravel's use of Facades when you call Session::get(), by default you Laravel will actually give you an instance of the Illuminate\Session\Store::class which is where you will find the ::get() method you are looking for.

When using PHPStorm it is only going to take you the Facade, not the concrete implementation that you are actually working with.

This is very common in Laravel, it'll take a bit of time for you to figure out which classes your actually working with, but diving into the framework will help you understand these things.

The Self::get() you are referring to looks to be Model class, which inherits the Illuminate\Database\Eloquent\Model::class