Command and tokens trait

This commit is contained in:
Maxime Renou
2020-05-12 15:57:23 +02:00
parent f057dd513c
commit 807d12a2b5
4 changed files with 167 additions and 90 deletions

View File

@@ -2,6 +2,7 @@
namespace Bluesquare\Connect;
use Bluesquare\Connect\Commands\Sync;
use Bluesquare\Connect\View\Components\Button;
use Illuminate\Support\ServiceProvider;
@@ -14,14 +15,34 @@ class ConnectServiceProvider extends ServiceProvider
*/
public function register()
{
// Config
$this->mergeConfigFrom(
__DIR__ . '/../config/bconnect.php',
'bmail'
'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')
]);
// Views
$this->loadViewsFrom(__DIR__.'/../resources/views/connect', 'connect');
@@ -32,17 +53,13 @@ class ConnectServiceProvider extends ServiceProvider
$this->loadViewComponentsAs('connect', [
Button::class
]);
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
$this->publishes([
__DIR__ . '/../config/bconnect.php' => config_path('bconnect.php')
], 'config');
// Commands
if ($this->app->runningInConsole()) {
$this->commands([
Sync::class
]);
}
}
}