Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Fixing problem where php artisan quarx:setup may not successfully r… #22

Merged
merged 1 commit into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ composer require yab/quarx
* Add the following to your Providers:

```php
Yab\Quarx\QuarxProvider::class
Yab\Quarx\QuarxProvider::class,
```

* Then run the vendor publish:
Expand Down
27 changes: 26 additions & 1 deletion src/Console/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Yab\Quarx\Console;

use Artisan;
use App\Models\User;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Config;
Expand Down Expand Up @@ -258,10 +259,34 @@ public function leaveAllTeams($userId)
]);

Artisan::call('migrate', [
'--seed' => true,
'--force' => true,
]);

// Seed the roles table
if (!\App\Models\Role::where('name', 'member')->first()) {
\App\Models\Role::create([
'name' => 'member',
'label' => 'Member',
]);
\App\Models\Role::create([
'name' => 'admin',
'label' => 'Admin',
]);
}

// Seed User table with a default admin account
$service = app(\App\Services\UserService::class);

if (!User::where('name', 'admin')->first()) {
$user = User::create([
'name' => 'Admin',
'email' => 'admin@admin.com',
'password' => bcrypt('admin'),
]);
}
$service->create($user, 'admin', 'admin', false);


$this->info('Finished setting up your site with Quarx');
$this->info('Please run:');
$this->comment('gulp');
Expand Down