-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add Coming Soon page with redirects enforced via Pennant + midd…
…leware
- Loading branch information
1 parent
3965240
commit ca4aeb7
Showing
12 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,3 +87,5 @@ DEPLOYMENT_IP= | |
DEPLOYMENT_USER=ubuntu | ||
DEPLOYMENT_SSH_KEY= | ||
DEPLOYMENT_PATH= | ||
|
||
COMING_SOON_ENABLED=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,4 +83,4 @@ VITE_REVERB_SCHEME="${REVERB_SCHEME}" | |
OCTANE_HTTPS=true | ||
OCTANE_SERVER=frankenphp | ||
|
||
|
||
COMING_SOON_ENABLED=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Closure; | ||
use Illuminate\Http\Request; | ||
use Laravel\Pennant\Feature; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
class ComingSoon | ||
{ | ||
/** | ||
* Handle an incoming request. | ||
* | ||
* @param Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next | ||
*/ | ||
public function handle(Request $request, Closure $next): Response | ||
{ | ||
if (Feature::active('coming-soon') && $request->route()->getName() !== 'coming-soon') { | ||
return redirect(route('coming-soon')); | ||
} | ||
|
||
if (Feature::inactive('coming-soon') && $request->route()->getName() === 'coming-soon') { | ||
return redirect(route('home')); | ||
} | ||
|
||
return $next($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
use function Laravel\Folio\name; | ||
name('coming-soon'); | ||
?> | ||
|
||
@extends('layouts.marketing', ['includeNav' => false]) | ||
|
||
@section('pageTitle') | ||
{{ config('app.name') . ' is coming soon!' }} | ||
@endsection | ||
|
||
@section('content') | ||
<section class="primary-section"> | ||
<div class="grid px-4 pb-8 mx-auto max-w-screen-xl lg:grid-cols-12 lg:gap-8 lg:pb-16 xl:gap-0"> | ||
<div class="place-self-center mr-auto lg:col-span-7"> | ||
<h1>Coming soon!</h1> | ||
<p class="headline">Something interesting this way comes...</p> | ||
</div> | ||
<div class="lg:flex lg:col-span-5 lg:mt-0"> | ||
Hero Image here | ||
</div> | ||
</div> | ||
</section> | ||
@endsection |