Add StaticPage controller instead of legals and policies
This commit is contained in:
parent
bd5be3fce1
commit
608803bd0c
5 changed files with 41 additions and 52 deletions
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Fo;
|
||||
|
||||
use App\Enums\StaticPageType;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\StaticPage;
|
||||
|
||||
class LegalController extends Controller
|
||||
{
|
||||
/**
|
||||
* Legal show
|
||||
*
|
||||
* @param \App\Models\StaticPage $legalPage
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function show(StaticPage $legalPage)
|
||||
{
|
||||
$legalPage = StaticPage::query()->where('type', StaticPageType::legals)
|
||||
->get();
|
||||
return view('fo.pages.legals', ['staticPageModel' => $legalPage[0]]);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Fo;
|
||||
|
||||
use App\Enums\StaticPageType;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\StaticPage;
|
||||
|
||||
class PolicyController extends Controller
|
||||
{
|
||||
/**
|
||||
* Legal show
|
||||
*
|
||||
* @param \App\Models\StaticPage $policyPage
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function show(StaticPage $policyPage)
|
||||
{
|
||||
$policyPage = StaticPage::query()->where('type', StaticPageType::confidentiality)
|
||||
->get();
|
||||
return view('fo.pages.legals', ['staticPageModel' => $policyPage[0]]);
|
||||
}
|
||||
}
|
||||
36
app/Http/Controllers/Fo/StaticPageController.php
Normal file
36
app/Http/Controllers/Fo/StaticPageController.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Fo;
|
||||
|
||||
use App\Enums\StaticPageType;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\StaticPage;
|
||||
|
||||
class StaticPageController extends Controller
|
||||
{
|
||||
/**
|
||||
* Legal show
|
||||
*
|
||||
* @param \App\Models\StaticPage $legalPage
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function legals(StaticPage $legalPage)
|
||||
{
|
||||
$legalPage = StaticPage::query()->where('type', StaticPageType::legals)
|
||||
->get();
|
||||
return view('fo.pages.legals', ['staticPageModel' => $legalPage[0]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Policies show
|
||||
*
|
||||
* @param \App\Models\StaticPage $policiesPage
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function policies(StaticPage $policiesPage)
|
||||
{
|
||||
$policiesPage = StaticPage::query()->where('type', StaticPageType::confidentiality)
|
||||
->get();
|
||||
return view('fo.pages.legals', ['staticPageModel' => $policiesPage[0]]);
|
||||
}
|
||||
}
|
||||
|
|
@ -17,8 +17,8 @@
|
|||
</div>
|
||||
<div class="container">
|
||||
<div class="row mb-5">
|
||||
<div class="col">
|
||||
{{ __($staticPageModel->content) }}
|
||||
<div class="col ck-content">
|
||||
{!! clean($staticPageModel->content) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
|
||||
use App\Http\Controllers\Fo\HomeController;
|
||||
use App\Http\Controllers\Fo\LegalController;
|
||||
use App\Http\Controllers\Fo\PolicyController;
|
||||
use App\Http\Controllers\Fo\StaticPageController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::middleware(['throttle:credentials'])
|
||||
|
|
@ -11,6 +10,6 @@ Route::middleware(['throttle:credentials'])
|
|||
Route::get('/', [HomeController::class, 'index'])->name('homepage');
|
||||
Route::view('/bs-demo', 'fo.pages.bs-demo')->name('bs-demo');
|
||||
|
||||
Route::get('/mentions-legales', [LegalController::class, 'show'])->name('legals.show');
|
||||
Route::get('/charte-de-confidentialite', [PolicyController::class, 'show'])->name('policies.show');
|
||||
Route::get('/mentions-legales', [StaticPageController::class, 'legals'])->name('legals.show');
|
||||
Route::get('/charte-de-confidentialite', [StaticPageController::class, 'policies'])->name('policies.show');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue