adrema/modules/Mailgateway/MailgatewayServiceProvider.php

45 lines
1.0 KiB
PHP

<?php
namespace Modules\Mailgateway;
use App\Setting\SettingFactory;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Modules\Mailgateway\Components\SettingView;
use Modules\Mailgateway\Types\LocalType;
use Modules\Mailgateway\Types\MailmanType;
class MailgatewayServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
app(SettingFactory::class)->register(MailgatewaySettings::class);
app(Router::class)->middleware(['web', 'auth:web'])->group(function ($router) {
$router->get('/setting/mailgateway', SettingView::class)->name('setting.mailgateway');
});
app()->bind('mail-gateways', fn () => collect([
LocalType::class,
MailmanType::class,
]));
View::addNamespace('mailgateway', __DIR__ . '/Components');
}
}