Once the meta file is generated, PhpStorm can map container keys to specific class types. This works for both string keys and class name arguments.
Examples of supported patterns:
- Resolving by key:
app('events') or \App::make('events'). - Resolving by class name:
app('App\SomeClass') or app(App\SomeClass::class). - Working with type-hinted variables:
/** @var \Illuminate\Foundation\Application $app */ $app->make('events')->fire();
app('events')->fire();
\App::make('events')->fire();
/** @var \Illuminate\Foundation\Application $app */
$app->make('events')->fire();
// When the key is not found, it uses the argument as class name
app('App\SomeClass');
// Also works with
app(App\SomeClass::class);