diff --git a/Makefile b/Makefile index 4476128b..d097b99c 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ install: build update: build @php composer.phar dump-autoload @php composer.phar update --no-interaction - @php artisan migrate + @php artisan migrate --force @echo "Done!" .PHONY: reset diff --git a/app/Database/seeds/DatabaseSeeder.php b/app/Database/seeds/DatabaseSeeder.php index 9d379886..f9d5c71b 100755 --- a/app/Database/seeds/DatabaseSeeder.php +++ b/app/Database/seeds/DatabaseSeeder.php @@ -25,7 +25,6 @@ class DatabaseSeeder extends Seeder } $path = database_path('seeds/'.$env.'.yml'); - print("Seeding seeds/$env.yml\n"); if(!file_exists($path)) { $path = database_path('seeds/prod.yml'); diff --git a/app/Services/DatabaseService.php b/app/Services/DatabaseService.php index f47c345b..7e6018b2 100644 --- a/app/Services/DatabaseService.php +++ b/app/Services/DatabaseService.php @@ -2,7 +2,9 @@ namespace App\Services; +use Log; use Carbon\Carbon; +use Illuminate\Database\QueryException; use Webpatser\Uuid\Uuid; use Symfony\Component\Yaml\Yaml; use Illuminate\Support\Facades\DB; @@ -58,7 +60,11 @@ class DatabaseService extends BaseService } } - DB::table($table)->insert($row); + try { + DB::table($table)->insert($row); + } catch(QueryException $e) { + Log::info($e->getMessage()); + } } } } diff --git a/modules/Installer/Http/Controllers/InstallerController.php b/modules/Installer/Http/Controllers/InstallerController.php index c8a9abd0..6fedb849 100644 --- a/modules/Installer/Http/Controllers/InstallerController.php +++ b/modules/Installer/Http/Controllers/InstallerController.php @@ -117,9 +117,13 @@ class InstallerController extends AppBaseController ); $log[] = 'Creating database'; - $this->dbService->setupDB(); + $console_out = $this->dbService->setupDB(); - return redirect('/'); + return view('installer::steps/step2a-completed', [ + 'console_output' => $console_out + ]); + + //return redirect('/'); } /** @@ -129,4 +133,9 @@ class InstallerController extends AppBaseController { } + + public function complete(Request $request) + { + return redirect('/'); + } } diff --git a/modules/Installer/Http/Routes/install.php b/modules/Installer/Http/Routes/install.php index 4ce0fd77..012d0fc6 100644 --- a/modules/Installer/Http/Routes/install.php +++ b/modules/Installer/Http/Routes/install.php @@ -8,3 +8,5 @@ Route::get('/step3', 'InstallerController@step3')->name('step3'); Route::post('/dbtest', 'InstallerController@dbtest')->name('dbtest'); Route::post('/dbsetup', 'InstallerController@dbsetup')->name('dbsetup'); + +Route::get('/complete', 'InstallerController@complete')->name('complete'); diff --git a/modules/Installer/Resources/views/app.blade.php b/modules/Installer/Resources/views/app.blade.php index 9efbb93d..c04307ef 100644 --- a/modules/Installer/Resources/views/app.blade.php +++ b/modules/Installer/Resources/views/app.blade.php @@ -18,6 +18,7 @@ + @yield('css') @@ -59,6 +60,8 @@
+ + diff --git a/modules/Installer/Resources/views/steps/step2a-completed.blade.php b/modules/Installer/Resources/views/steps/step2a-completed.blade.php new file mode 100644 index 00000000..5af7b17d --- /dev/null +++ b/modules/Installer/Resources/views/steps/step2a-completed.blade.php @@ -0,0 +1,18 @@ +@extends('installer::app') +@section('title', 'Database Setup') +@section('content') +
+
+ {!! $console_output !!}
+
+
+
+ + {!! Form::submit('Complete Setup >>', ['class' => 'btn btn-success']) !!} +
+ {!! Form::close() !!} +