PHP code example of antriver / laravel-singleton-discovery

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

    

antriver / laravel-singleton-discovery example snippets


app(SomeClass::class) === app(SomeClass::class); // false

app()->singleton(SomeClass::class);

    'providers' => [
        // ...
        Antriver\LaravelSingletonDiscovery\SingletonDiscoveryServiceProvider::class,
        // ...
    ],