Skip to content

Commit

Permalink
Refactor: routes have been updated according to the new version of La…
Browse files Browse the repository at this point in the history
…ravel
  • Loading branch information
Fahri Meral committed Apr 29, 2024
1 parent f933cdb commit df92c5f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 86 deletions.
120 changes: 40 additions & 80 deletions src/Routes/web.php
Original file line number Diff line number Diff line change
@@ -1,84 +1,44 @@
<?php

Route::group(['prefix' => 'install', 'as' => 'LaravelInstaller::', 'namespace' => 'Smarteknoloji\SmartInstaller\Controllers', 'middleware' => ['web', 'install']], function () {
Route::get('/', [
'as' => 'welcome',
'uses' => 'WelcomeController@welcome',
]);

Route::get('environment', [
'as' => 'environment',
'uses' => 'EnvironmentController@environmentMenu',
]);

Route::get('environment/wizard', [
'as' => 'environmentWizard',
'uses' => 'EnvironmentController@environmentWizard',
]);

Route::post('environment/saveWizard', [
'as' => 'environmentSaveWizard',
'uses' => 'EnvironmentController@saveWizard',
]);

Route::get('environment/classic', [
'as' => 'environmentClassic',
'uses' => 'EnvironmentController@environmentClassic',
]);

Route::post('environment/saveClassic', [
'as' => 'environmentSaveClassic',
'uses' => 'EnvironmentController@saveClassic',
]);

Route::get('requirements', [
'as' => 'requirements',
'uses' => 'RequirementsController@requirements',
]);

Route::get('permissions', [
'as' => 'permissions',
'uses' => 'PermissionsController@permissions',
]);

Route::get('database/requirements', [
'as' => 'databaseRequirements',
'uses' => 'DatabaseController@requirements',
]);

Route::get('database', [
'as' => 'database',
'uses' => 'DatabaseController@database',
]);

Route::get('final', [
'as' => 'final',
'uses' => 'FinalController@finish',
]);
});

Route::group(['prefix' => 'update', 'as' => 'LaravelUpdater::', 'namespace' => 'Smarteknoloji\SmartInstaller\Controllers', 'middleware' => 'web'], function () {
Route::group(['middleware' => 'update'], function () {
Route::get('/', [
'as' => 'welcome',
'uses' => 'UpdateController@welcome',
]);

Route::get('overview', [
'as' => 'overview',
'uses' => 'UpdateController@overview',
]);

Route::get('database', [
'as' => 'database',
'uses' => 'UpdateController@database',
]);
use Illuminate\Support\Facades\Route;
use Smarteknoloji\SmartInstaller\Controllers\DatabaseController;
use Smarteknoloji\SmartInstaller\Controllers\EnvironmentController;
use Smarteknoloji\SmartInstaller\Controllers\FinalController;
use Smarteknoloji\SmartInstaller\Controllers\PermissionsController;
use Smarteknoloji\SmartInstaller\Controllers\RequirementsController;
use Smarteknoloji\SmartInstaller\Controllers\UpdateController;
use Smarteknoloji\SmartInstaller\Controllers\WelcomeController;

Route::prefix('install')
->as('LaravelInstaller::')
->middleware(['web', 'install'])
->group(function () {
Route::get('/', [WelcomeController::class, 'welcome'])->name('welcome');
Route::get('environment', [EnvironmentController::class, 'environmentMenu'])->name('environment');
Route::get('environment/wizard', [EnvironmentController::class, 'environmentWizard'])->name('environmentWizard');
Route::post('environment/saveWizard', [EnvironmentController::class, 'saveWizard'])->name('saveWizard');
Route::get('environment/classic', [EnvironmentController::class, 'environmentClassic'])->name('environmentClassic');
Route::post('environment/saveClassic', [EnvironmentController::class, 'saveClassic'])->name('saveClassic');
Route::get('requirements', [RequirementsController::class, 'requirements'])->name('requirements');
Route::get('permissions', [PermissionsController::class, 'permissions'])->name('permissions');
Route::get('database/requirements', [DatabaseController::class, 'requirements'])->name('databaseRequirements');
Route::get('database', [DatabaseController::class, 'database'])->name('database');
Route::get('final', [FinalController::class, 'finish'])->name('final');
});

// This needs to be out of the middleware because right after the migration has been
// run, the middleware sends a 404.
Route::get('final', [
'as' => 'final',
'uses' => 'UpdateController@finish',
]);
});
Route::prefix('update')
->as('LaravelUpdater::')
->middleware(['web'])
->group(function () {
Route::controller(UpdateController::class)
->middleware(['update'])
->group(function () {
Route::get('/', 'welcome')->name('welcome');
Route::get('overview', 'overview')->name('overview');
Route::post('database', 'database')->name('database');
});

// This needs to be out of the middleware because right after the migration has been
// run, the middleware sends a 404.
Route::get('final', [UpdateController::class, 'finish'])->name('final');
});
4 changes: 1 addition & 3 deletions src/Views/environment-classic.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
@endsection

@section('container')

<form method="post" action="{{ route('LaravelInstaller::environmentSaveClassic') }}">
<form method="post" action="{{ route('LaravelInstaller::saveClassic') }}">
@csrf
<textarea class="textarea" name="envConfig" aria-label="env">{{ $envConfig }}</textarea>

Expand All @@ -43,5 +42,4 @@
</div>
@endif
</form>

@endsection
4 changes: 1 addition & 3 deletions src/Views/environment-wizard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

@section('container')
<div class="tabs tabs-full">

<input id="tab1" type="radio" name="tabs" class="tab-input" checked />
<label for="tab1" class="tab-label">
<i class="fa fa-cog fa-2x fa-fw" aria-hidden="true"></i>
Expand All @@ -48,7 +47,7 @@
{{ trans('installer_messages.environment.wizard.tabs.application') }}
</label>

<form method="post" action="{{ route('LaravelInstaller::environmentSaveWizard') }}" class="tabs-wrap">
<form method="post" action="{{ route('LaravelInstaller::saveWizard') }}" class="tabs-wrap">
<div class="tab" id="tab1content">
<input type="hidden" name="_token" value="{{ csrf_token() }}">

Expand Down Expand Up @@ -665,7 +664,6 @@
</div>
</div>
</form>

</div>
@endsection

Expand Down

0 comments on commit df92c5f

Please sign in to comment.