PHP code example of codezero / composer-preload-files

1. Go to this page and download the library: Download codezero/composer-preload-files library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codezero / composer-preload-files example snippets


// helpers.php
if ( ! function_exists('route')) {
    function route($name, $parameters = [], $absolute = true)
    {
        return app('url')->route($name, $parameters, $absolute);
    }
}


json
"extra": {
    "preload-files": [
        "app/helpers.php"
    ]
},
json
"autoload": {
    "files": [
        "src/Illuminate/Collections/helpers.php",
        "src/Illuminate/Events/functions.php",
        "src/Illuminate/Foundation/helpers.php",
        "src/Illuminate/Support/helpers.php"
    ]
},