mirror of
https://github.com/phpmon/website
synced 2026-03-31 17:20:09 +02:00
Added privacy policy, upgrades
This commit is contained in:
25
app/Http/PrivacyPolicyController.php
Normal file
25
app/Http/PrivacyPolicyController.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
final class PrivacyPolicyController
|
||||
{
|
||||
public function __invoke(): View
|
||||
{
|
||||
$markdown = file_get_contents(resource_path('markdown/privacy_policy.md'));
|
||||
$content = (new CommonMarkConverter)->convert($markdown);
|
||||
|
||||
$timestamp = filemtime(resource_path('markdown/privacy_policy.md'));
|
||||
$modified = date('Y-m-d', $timestamp);
|
||||
|
||||
return view('privacy-policy', [
|
||||
'content' => $content,
|
||||
'lastUpdated' => $modified,
|
||||
]);
|
||||
}
|
||||
}
|
||||
27
app/Http/ReleaseNotesController.php
Normal file
27
app/Http/ReleaseNotesController.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
final class ReleaseNotesController
|
||||
{
|
||||
public function __invoke(): View
|
||||
{
|
||||
$path = public_path('builds/early-access/sponsors/changelog.md');
|
||||
|
||||
if (! file_exists($path)) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$content = (new CommonMarkConverter)
|
||||
->convert(file_get_contents($path));
|
||||
|
||||
return view('changelog', [
|
||||
'content' => $content,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -4,21 +4,13 @@
|
||||
|
||||
use App\Http\Redirection;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
Route::get('/', fn () => view('homepage'));
|
||||
|
||||
Route::get('/early-access/release-notes', function () {
|
||||
$path = public_path('builds/early-access/sponsors/changelog.md');
|
||||
if (file_exists($path)) {
|
||||
return view('changelog', [
|
||||
'content' => (new CommonMarkConverter)
|
||||
->convert(file_get_contents($path)),
|
||||
]);
|
||||
} else {
|
||||
abort(404);
|
||||
}
|
||||
});
|
||||
Route::get('/privacy-policy', \App\Http\PrivacyPolicyController::class)
|
||||
->name('privacy-policy');
|
||||
Route::get('/early-access/release-notes', \App\Http\ReleaseNotesController::class)
|
||||
->name('release-notes');
|
||||
|
||||
collect([
|
||||
Redirection::named('github', '/github', 'https://github.com/nicoverbruggen/phpmon'),
|
||||
|
||||
Reference in New Issue
Block a user