vito/app/Providers/AppServiceProvider.php
Saeed Vaziry e997d0deea
WIP notifications and other refactors (#88)
* WIP notifications and other refactors
- refactor notification channels
- send notifications on events related to the servers and sites
- delete server log files on server deletion
- add telegram notification channel
- add new icons
- cache configs and icons on installation and updates
- new navbar for dark mode and settings

* discord channel

* build assets

* pint
2024-01-07 09:54:08 +01:00

56 lines
1.3 KiB
PHP

<?php
namespace App\Providers;
use App\Helpers\Notifier;
use App\Helpers\SSH;
use App\Support\SocialiteProviders\DropboxProvider;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\Resources\Json\ResourceCollection;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* @throws BindingResolutionException
*/
public function boot(): void
{
ResourceCollection::withoutWrapping();
// facades
$this->app->bind('ssh', function () {
return new SSH;
});
$this->app->bind('notifier', function () {
return new Notifier;
});
$this->extendSocialite();
}
/**
* @throws BindingResolutionException
*/
private function extendSocialite(): void
{
$socialite = $this->app->make('Laravel\Socialite\Contracts\Factory');
$socialite->extend(
'dropbox',
function ($app) use ($socialite) {
$config = $app['config']['services.dropbox'];
return $socialite->buildProvider(DropboxProvider::class, $config);
}
);
}
}