And laravel version?

|
natghi2010 2021-02-27 13:50:08
I have this problem. I have a sidebar which sets the current menu item to active when thats the page its on.
natghi2010 2021-02-27 13:50:42
laravel_discuss-71860.jpg

natghi2010 2021-02-27 13:51:29
but when it nests to sub route, this doesnt work. because the way its working now is by specific route.
natghi2010 2021-02-27 13:51:57
is there a way to get the active ‘prefix’ of the route to achieve this?
Batu157 2021-02-27 13:52:58
You can easily use jquery, find the a href which matches with the current url and set active all parents of that <ul> for example
natghi2010 2021-02-27 13:54:32
Batu157 2021-02-27 13:52:58
You can easily use jquery, find the a href which matches with the current url and set active all parents of that <ul> for example

oh boy

2021-02-27 14:00:45
natghi2010 2021-02-27 13:51:57
is there a way to get the active ‘prefix’ of the route to achieve this?

{{ Request::is(‘dashboard’) ? ‘active’ : ‘ ‘}}

natghi2010 2021-02-27 14:01:03
2021-02-27 14:00:45
{{ Request::is(‘dashboard’) ? ‘active’ : ‘ ‘}}

thats currently how its implemented

natghi2010 2021-02-27 14:01:31
2021-02-27 14:00:45
{{ Request::is(‘dashboard’) ? ‘active’ : ‘ ‘}}

Request::is(‘user’) works but
if its user/create, it doesnt work

2021-02-27 14:01:53
You need to specify it again
natghi2010 2021-02-27 14:02:07
2021-02-27 14:01:53
You need to specify it again

what if it has many sub routes

natghi2010 2021-02-27 14:02:25
I can do it one by one but im looking for a clean way to do it
Batu157 2021-02-27 14:02:42
natghi2010 2021-02-27 14:02:25
I can do it one by one but im looking for a clean way to do it

use what i said then

natghi2010 2021-02-27 14:03:02
Batu157 2021-02-27 14:02:42
use what i said then

on every project?

Batu157 2021-02-27 14:03:23
you should change something in every project eitherway
2021-02-27 14:03:34
You may use parent routes active (user*’)
natghi2010 2021-02-27 14:08:15
Batu157 2021-02-27 14:03:23
you should change something in every project eitherway

so it turns out im a dumbass

natghi2010 2021-02-27 14:08:29
2021-02-27 14:03:34
You may use parent routes active (user*’)

the solution is pretty much :
@if(Request::is(‘admin/*’))
<h1>Show some data</h1>
@endif

natghi2010 2021-02-27 14:08:45
2021-02-27 14:03:34
You may use parent routes active (user*’)

right

natghi2010 2021-02-27 14:10:33
Batu157 2021-02-27 14:03:23
you should change something in every project eitherway

thanks for the help

Batu157 2021-02-27 14:12:27
2021-02-27 14:03:34
You may use parent routes active (user*’)

The problem of this is what if routes doesn’t start with user?
You could have a menu called maintenance for example, with nested stuff like clients, projects etc

natghi2010 2021-02-27 14:17:09
Batu157 2021-02-27 14:12:27
The problem of this is what if routes doesn’t start with user?
You could have a menu called maintenance for example, with nested stuff like clients, projects etc

I think you can do */user/*

natghi2010 2021-02-27 14:17:21
while guess though
akhmatkhonov 2021-02-27 14:53:32
Hello guys! I am trying to unify month values into one string so my question is how to convert the string 01:0 | 02:0 | 03:7.64 | 04:0 | 05:13.84 | 06:23.56 | 07:0 | 08:0 | 09:37.96 | 10:0 | 11:0 | 12:48 | 01: | 02: | 03: | 04:3 | 05: | 06: | 07: | 08: | 09: | 10: to 01:0 | 02:0 | 03:7.64 | 04:3 | 05:13.84 | 06:23.56 | 07:0 | 08:0 | 09:37.96 | 10:0 | 11:0 | 12:48 ?
sbruder 2021-02-27 15:02:24
akhmatkhonov 2021-02-27 14:53:32
Hello guys! I am trying to unify month values into one string so my question is how to convert the string 01:0 | 02:0 | 03:7.64 | 04:0 | 05:13.84 | 06:23.56 | 07:0 | 08:0 | 09:37.96 | 10:0 | 11:0 | 12:48 | 01: | 02: | 03: | 04:3 | 05: | 06: | 07: | 08: | 09: | 10: to 01:0 | 02:0 | 03:7.64 | 04:3 | 05:13.84 | 06:23.56 | 07:0 | 08:0 | 09:37.96 | 10:0 | 11:0 | 12:48 ?

Explode()?

sbruder 2021-02-27 15:03:09
I assume by “convert string” … to an array?
akhmatkhonov 2021-02-27 15:13:27
sbruder 2021-02-27 15:02:24
Explode()?

If I will explode it, can two-digit numbers like 01,02,03 be array integer keys(index)?

valenci007 2021-02-27 15:17:35
Hi, I am trying to return a custom json response when a user access a protected route without a valid token/ token. i have written the my custom response inside the authenticate middleware, but i still get response that i don’t know how to override below is the response i get and my code inside authenticate middleware
{“message”: “Unauthenticated”}
my custom response
protected function redirectTo($request)
{
if ($request->expectsJson()) {
return response()->json([
‘status’ => ‘failed’,
“message” => “unauthenticated”,
“error” => “unauthenticated”
],401);
}
}
Romil 2021-02-27 17:35:13
laravel_discuss-71894.jpg

Romil 2021-02-27 17:35:24
Please help for this issue
Romil 2021-02-27 17:35:47
I’m debugging since morning but still I’m not getting any solution
Romil 2021-02-27 17:36:15
I request to all of you guys help me if any one know about this issue
natghi2010 2021-02-27 17:57:03
Romil 2021-02-27 17:35:13

php version?

natghi2010 2021-02-27 17:57:15
and laravel version?
2021-02-27 18:01:51
composer install
|