Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to automatically load a file must execute the command composer dump-autoload

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to automatically load a file must be executed after the command composer dump-autoload, editor feel very practical, so share with you to learn, I hope you can learn something after reading this article, say no more, follow the editor to have a look.

You must execute the command after automatically loading a file

{"name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": {"laravel/framework": "4.2.*", "pda/pheanstalk": "~ 2.0"," doctrine/dbal ":" 2.4.* "," guzzlehttp/guzzle ":" 5.3.1 " "firebase/php-jwt": "4.0"," twilio/sdk ":" 5.7", "ircmaxell/random-lib": "1.2"," mjaschen/phpgeo ":" 1.3", "dompdf/dompdf": "0.8.2"," league/csv ":" 9.2"}, "autoload": {# automatic loading, divided into files (the value corresponding to the files key is an array) The array element is the path of the file, and the path is relative to the root directory of the application) and classmap (the method introduced through the file is intuitive, but very laborious, each file has to be introduced once, which is really not a good solution. We can use classmap, that is, compatible with files. "classmap": ["app/commands", "app/controllers", "app/models", "app/database/migrations", "app/database/seeds", "app/tests/TestCase.php", "app/libraries", "app/helpers", "app/logic", "app/jobs", "app/validators" "app/3rd", "app/classes", "app/filters"]}, "scripts": {"post-install-cmd": ["php artisan clear-compiled", "php artisan optimize"], "post-update-cmd": ["php artisan clear-compiled", "php artisan optimize"] "post-create-project-cmd": ["php artisan key:generate"]}, "config": {"preferred-install": "dist"}, "minimum-stability": "stable", "require-dev": {"phpunit/phpunit": "4.8"}," repositories ": {" packagist ": {" type ":" composer " "url": "https://packagist.laravel-china.org"}

Because app\ logic loads automatically, there is theoretically no need to change each file change, but you will encounter the problem that the ide code cannot jump, which needs to be executed.

Composer dump-autoload

2. If ide still fails to jump, you can try

Logic layer factory class, comment @ return item, add the required logic layer (ShopLogic), ide can recognize the jump

The above is how to automatically load a file after you must execute the command composer dump-autoload, editor believes that there are some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report