Add useful links support to sidebar

This commit is contained in:
DariusIII
2025-11-27 12:43:15 +01:00
parent ff51661dd5
commit 0cf6ea4e8b
3 changed files with 186 additions and 8 deletions
@@ -4,6 +4,7 @@ namespace App\View\Composers;
use App\Events\UserLoggedIn;
use App\Models\Category;
use App\Models\Content;
use App\Models\Settings;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
@@ -34,6 +35,13 @@ class GlobalDataComposer
$viewData['site'] = $siteArray; // Now it's a proper array, not a Settings model
}
// Load useful links for sidebar
$usefulLinks = Content::active()
->ofType(Content::TYPE_USEFUL)
->orderBy('ordinal')
->get();
$viewData['usefulLinks'] = $usefulLinks;
if (Auth::check()) {
$userdata = User::find(Auth::id());
$userdata->categoryexclusions = User::getCategoryExclusionById(Auth::id());