37 lines
958 B
PHP
37 lines
958 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Lvl0\FediDiscover;
|
|
|
|
use Illuminate\Support\Facades\Event;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Lvl0\FediDiscover\Console\Commands\ValidateInstancesCommand;
|
|
use Lvl0\FediDiscover\Events\UrlDiscovered;
|
|
|
|
class FediDiscoverServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
$this->mergeConfigFrom(__DIR__ . '/../config/fedi-discover.php', 'fedi-discover');
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
|
|
|
|
Event::listen(
|
|
UrlDiscovered::class,
|
|
);
|
|
|
|
if ($this->app->runningInConsole()) {
|
|
$this->publishes([
|
|
__DIR__ . '/../config/fedi-discover.php' => config_path('fedi-discover.php'),
|
|
], 'fedi-discover-config');
|
|
|
|
$this->commands([
|
|
ValidateInstancesCommand::class,
|
|
]);
|
|
}
|
|
}
|
|
}
|