diff --git a/resources/views/components/sidebar/button.blade.php b/resources/views/components/sidebar/button.blade.php index c675b65..5d5f817 100644 --- a/resources/views/components/sidebar/button.blade.php +++ b/resources/views/components/sidebar/button.blade.php @@ -6,8 +6,18 @@ @php +use App\Models\Task; + $selected = request()->path() == $href; +// Check if task is in the url +if (str_contains(request()->path(), 'task') && request()->route()->hasParameter('id')) { + $task = Task::find(request()->route()->parameter('id')); + if ($href == "project/".$task->project_id) { + $selected = true; + } +} + @endphp