You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

71 lines
1.5 KiB

<?php
namespace Bluesquare\Connect;
use Bluesquare\Connect\Commands\Sync;
use Illuminate\Support\ServiceProvider;
class ConnectServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
// Config
$this->mergeConfigFrom(
__DIR__ . '/../config/bconnect.php',
'bconnect'
);
// Singletons
$this->app->singleton(Connect::class, function ($app) {
return new Connect($app);
});
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// Config
$this->publishes([
__DIR__ . '/../config/bconnect.php' => config_path('bconnect.php')
]);
// Translations
$this->loadTranslationsFrom(__DIR__.'/../resources/translations', 'connect');
// Views
$this->loadViewsFrom(__DIR__.'/../resources/views/connect', 'connect');
$this->publishes([
__DIR__.'/../resources/views/connect' => resource_path('views/vendor/connect'),
]);
if (method_exists($this, 'loadViewComponentsAs')) {
// Laravel 7+
$this->loadViewComponentsAs('connect', [
\Bluesquare\Connect\View\Components\Button::class
]);
}
// Commands
if ($this->app->runningInConsole()) {
$this->commands([
Sync::class
]);
}
}
}