Issue/329 refactor seeding (#337)
* Fix Contracts class names * Refactoring of the file seeds so it's not a mess * StyleCI fixes
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Modules\Installer\Http\Controllers;
|
||||
|
||||
use App\Contracts\Controller;
|
||||
use App\Services\Installer\MigrationService;
|
||||
use App\Services\Installer\SeederService;
|
||||
use function count;
|
||||
use Illuminate\Http\Request;
|
||||
use Log;
|
||||
@@ -16,15 +17,19 @@ use Log;
|
||||
class UpdaterController extends Controller
|
||||
{
|
||||
private $migrationSvc;
|
||||
private $seederSvc;
|
||||
|
||||
/**
|
||||
* UpdaterController constructor.
|
||||
* @param MigrationService $migrationSvc
|
||||
* @param SeederService $seederSvc
|
||||
*/
|
||||
public function __construct(
|
||||
MigrationService $migrationSvc
|
||||
MigrationService $migrationSvc,
|
||||
SeederService $seederSvc
|
||||
) {
|
||||
$this->migrationSvc = $migrationSvc;
|
||||
$this->seederSvc = $seederSvc;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,12 +71,12 @@ class UpdaterController extends Controller
|
||||
|
||||
$migrations = $this->migrationSvc->migrationsAvailable();
|
||||
if(count($migrations) === 0) {
|
||||
$this->migrationSvc->syncAllSeeds();
|
||||
$this->seederSvc->syncAllSeeds();
|
||||
return view('installer::update/steps/step3-update-complete');
|
||||
}
|
||||
|
||||
$output = $this->migrationSvc->runAllMigrations();
|
||||
$this->migrationSvc->syncAllSeeds();
|
||||
$this->seederSvc->syncAllSeeds();
|
||||
|
||||
return view('installer::update/steps/step2-migrations-done', [
|
||||
'console_output' => $output,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
@section('content')
|
||||
<h2>phpvms updater</h2>
|
||||
<p>Updates have been found, click run to complete the update!.</p>
|
||||
<p>Click run to complete the update!.</p>
|
||||
{{ Form::open(['route' => 'update.run_migrations', 'method' => 'post']) }}
|
||||
<p style="text-align: right">
|
||||
{{ Form::submit('Run >>', ['class' => 'btn btn-success']) }}
|
||||
|
||||
Reference in New Issue
Block a user