first commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Rodev\DelegateAuth\Console;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class InstallCommand extends Command
|
||||
{
|
||||
protected $signature = 'delegate-auth:install';
|
||||
protected $description = 'Publie la configuration de delegate-auth';
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$this->callSilent('vendor:publish', [
|
||||
'--provider' => 'Rodev\\DelegateAuth\\DelegateAuthServiceProvider',
|
||||
'--tag' => 'delegate-auth-config',
|
||||
]);
|
||||
|
||||
$this->info('Config publiée dans config/delegate-auth.php');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Rodev\DelegateAuth;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class DelegateAuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->mergeConfigFrom(
|
||||
__DIR__.'/../config/delegate-auth.php', 'delegate-auth'
|
||||
);
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__.'/../config/delegate-auth.php' => config_path('delegate-auth.php'),
|
||||
], 'delegate-auth-config');
|
||||
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([
|
||||
Console\InstallCommand::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user