Skip to content

Commit

Permalink
bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeblauw committed Nov 26, 2024
1 parent 5943a3a commit af44dd0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/layouts/flux/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
@endif

<div class="flex-1 max-md:pt-6 self-stretch mb-6">
{{implode(',', $sidebar)}}
{{ is_array($sidebar) ? implode(',', $sidebar) : $sidebar }}

@if($titleShow && $title)
<flux:heading size="xl" level="1">{{$title}}</flux:heading>
Expand Down
8 changes: 8 additions & 0 deletions src/View/Components/Adminlayout/AdminLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,21 @@ private function findActiveTopLevelMenuItem()
$this->current_route = Route::current()->uri;
$routename = Route::currentRouteName();

dump($this->current_route);
dump($routename);

$fake_index_routename = str($routename)->replace(['show', 'create', 'edit'], 'index')->toString();
$current_route = Route::has($fake_index_routename)
? str(route($fake_index_routename))->replace(config('app.url').'/','')->toString()
: Route::current()->uri;

dump($current_route);

// Check if it was one of the top level routes
$top_routes = collect(config('blue-admin.fluxmenu.top'))->map( fn($item) => $item['link'])->filter(fn($item) => $current_route == $item);

if( $top_routes->isNotEmpty()){
dump('returning CURRENT_ROUTE');
return $current_route;
}

Expand All @@ -69,6 +75,8 @@ private function findActiveTopLevelMenuItem()
return $element['topmenu'];
}

dump('NOTHING FOUNT');

return null;
}
}

0 comments on commit af44dd0

Please sign in to comment.