Set up redirects

This commit is contained in:
2022-09-05 19:54:06 +02:00
parent cfb14498d4
commit 792a4aee9b
4 changed files with 49 additions and 6 deletions

View File

@ -1,9 +1,16 @@
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Redirection;
Route::get('/', fn () => view('homepage'));
Route::get('/github', fn () => redirect()->to('https://github.com/nicoverbruggen/phpmon'));
Route::get('/sponsor', fn () => redirect()->to('https://nicoverbruggen.be/sponsor'));
Route::get('/donate', fn () => redirect()->to('https://nicoverbruggen.be/sponsor'));
collect([
Redirection::named('github', '/github', 'https://github.com/nicoverbruggen/phpmon'),
Redirection::named('releases', '/releases', 'https://github.com/nicoverbruggen/phpmon/releases'),
Redirection::named('faq', '/faq', 'https://github.com/nicoverbruggen/phpmon#%EF%B8%8F-faq--troubleshooting'),
Redirection::named('sponsor', '/sponsor', 'https://nicoverbruggen.be/sponsor'),
Redirection::named('sponsor.now', '/sponsor/now', 'https://nicoverbruggen.be/sponsor#pay-now'),
])->each(function (Redirection $r) {
Route::get($r->url, fn () => redirect()->to($r->target))->name($r->name);
});