PHP code example of theofidry / laravel-yaml

1. Go to this page and download the library: Download theofidry/laravel-yaml 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/ */

    

theofidry / laravel-yaml example snippets


# app/Providers/AppServiceProvider.php

//...
public function register()
{
    $this->app->singleton(
        'dummy_service',
        function ($app) {
            $url = env('APP_URL');
            $env = env('APP_ENV');

            return new \App\Services\DummyService($url, $env);
        }
    );
}


// config/app.php

'providers' => [
    // ...
    \Fidry\LaravelYaml\Provider\DefaultExtensionProvider::class,
];