Use PHPStorm advanced metadata Author: Chuwen Time: 2023-02-11 Classification: Laravel , PHP ##Example 1 You want to get the user model through '$request ->user()', but it's very annoying that there is no type prompt. You can do this Create a file '. phpstrom. meta. php' in the project and path, and then write: ```php <? php // @formatter:off namespace PHPSTORM_META { //Define Output Type override(\Illuminate\Http\Request::user(), map([ '' => \App\Models\User::class, ])); } ``` Then there will be a type prompt: ! []( https://cdn.nowtime.cc/2023/02/10/1231715426.png ) For more advanced usage, see: https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html#map label: PHP , Laravel