autoload file laravel 1

autoload file laravel

Inside composer.json file
  "autoload": {
        "files": [
            "app/Helpers/helpers.php"
        ]
  	}

Here is what the above code is Doing:
1. It’s telling composer to load the helpers.php file in the app/Helpers directory.
2. It’s telling composer to load the helpers.php file every time the application is booted.

Now, we need to run the following command to update the composer autoloader:

composer dump-autoload

Now, we can use the helper functions in our application.

Similar Posts