Answers for "how to create singleton laravel"

PHP
0

how to create singleton laravel

use App\Services\Transistor;
use App\Services\PodcastParser;
 
$this->app->singleton(Transistor::class, function ($app) {
    return new Transistor($app->make(PodcastParser::class));
});
Posted by: Guest on April-28-2022

Browse Popular Code Answers by Language