Commit 95745ad9 authored by Nicolas Widart's avatar Nicolas Widart

set the correct default choice. Add a first pass at the Sentry installation

parent 65f0c392
...@@ -70,7 +70,7 @@ class InstallCommand extends Command ...@@ -70,7 +70,7 @@ class InstallCommand extends Command
$this->configureDatabase(); $this->configureDatabase();
$userDriver = $this->choice('Which user driver do you wish to use?', ['Sentinel', 'Sentry'], 'Sentry'); $userDriver = $this->choice('Which user driver do you wish to use?', ['Sentinel', 'Sentry'], 1);
$userDriver = "run{$userDriver}UserCommands"; $userDriver = "run{$userDriver}UserCommands";
$this->$userDriver(); $this->$userDriver();
...@@ -97,6 +97,7 @@ class InstallCommand extends Command ...@@ -97,6 +97,7 @@ class InstallCommand extends Command
$this->info('Running Sentinel migrations...'); $this->info('Running Sentinel migrations...');
$this->runSentinelMigrations(); $this->runSentinelMigrations();
$this->info('Running Sentinel seed...');
$this->call('db:seed', ['--class' => 'Modules\User\Database\Seeders\SentinelGroupSeedTableSeeder']); $this->call('db:seed', ['--class' => 'Modules\User\Database\Seeders\SentinelGroupSeedTableSeeder']);
$this->replaceUserRepositoryBindings('Sentinel'); $this->replaceUserRepositoryBindings('Sentinel');
...@@ -110,6 +111,22 @@ class InstallCommand extends Command ...@@ -110,6 +111,22 @@ class InstallCommand extends Command
$this->info('User commands done.'); $this->info('User commands done.');
} }
private function runSentryUserCommands()
{
$this->info('Running Sentry migrations...');
$this->call('migrate', ['--package' => 'cartalyst/sentry']);
$this->info('Running Sentry seed...');
$this->call('db:seed', ['--class' => 'Modules\User\Database\Seeders\SentryGroupSeedTableSeeder']);
$this->call('publish:config', ['package' => 'cartalyst/sentry']);
$this->replaceCartalystUserModelConfiguration('Cartalyst\Sentry\Users\Eloquent\User', 'Sentry');
$this->createFirstUser();
$this->info('User commands done.');
}
/** /**
* Create the first user that'll have admin access * Create the first user that'll have admin access
*/ */
...@@ -129,7 +146,7 @@ class InstallCommand extends Command ...@@ -129,7 +146,7 @@ class InstallCommand extends Command
'password' => Hash::make($password), 'password' => Hash::make($password),
]; ];
$user = app('Modules\User\Repositories\UserRepository'); $user = app('Modules\User\Repositories\UserRepository');
$user->createWithRoles($userInfo, [1]); $user->createWithRoles($userInfo, [1], true);
$this->info('Admin account created!'); $this->info('Admin account created!');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment