Extension Install

This commit is contained in:
root
2025-12-03 14:23:33 +01:00
parent a06fdcb317
commit 2cea264127
29 changed files with 1795 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
use Illuminate\Support\Facades\Route;
use Paymenter\Extensions\Others\NavbarManager\Models\NavbarLink;
Route::group(['prefix' => 'navbar'], function () {
Route::get('/redirect/{linkId}', function($linkId) {
try {
$link = NavbarLink::findOrFail($linkId);
if (!$link->is_active) {
abort(404);
}
if ($link->link_type === 'path' && $link->custom_path) {
return redirect($link->custom_path);
} elseif ($link->link_type === 'url' && $link->custom_url) {
return redirect($link->custom_url);
}
abort(404);
} catch (\Exception $e) {
abort(404);
}
})->name('navbar.redirect');
});