-
app/Providers/ImgServiceProvider.php
Open in GitHubuse App\Services\ImgService; use Illuminate\Support\ServiceProvider; class ImgServiceProvider extends ServiceProvider { public function register() { $this->app->singleton(ImgService::class, function ($app) { return new ImgService(); }); $this->app->alias(ImgService::class, 'img'); } }
-
config/app.php
Open in GitHubreturn [ // 'providers' => [ // App\Providers\ImgServiceProvider::class, ], // ];