30 Days to Learn Laravel, Ep 05 - Style the Currently Active Navigation Link
ฝัง
- เผยแพร่เมื่อ 8 ก.พ. 2025
- In this lesson, we'll learn how to apply special styling to the navigation link that matches the current page. Laravel provides a Request object that makes things like this a cinch.
Watch Full Series on: laracasts.com/...
Watch thousands of videos, track your progress, and participate in a massive Laravel community at Laracasts.com.
Laracasts: laracasts.com
Laracasts Twitter: / laracasts
Jeffrey Way Twitter: / jeffrey_way
I havent touched laravel since v7. Im amazed how powerful blade has become!
Same! These components simply feels on Another Level! Wow! 😲😊
This might be the best course im following so far, youre fun to listen and I do not get distracted easily listening to you. Plus you know your shit. Good job bro and thanks for giving us this quality for free!
oh my god how perfect this course is!
Hey, I watched your video super closely! It was hilarious seeing you raise your hand so high and then tapping away on the keyboard at the end of day 3. Totally cracked me up, but I loved it! And on day 5, I noticed you did it again-definitely on purpose, right? Haha, still fun and it’s great to see how interestingly you teach.
Great, I was waiting part 05 two days, please cosider a complete and advanced tutorial on udemy, I will defently buy.
You can check laracasts.com
Great series. Amazing attention to detail. Thanks!
06:02
un-necessarily complicating nav-links with just 3 items, in a beginners course!
That might have been a part of larabits or in advanced blade capabilities course
Agreed!
After some time spent not getting the desired result, it dawned on me that I was viewing the output in a skinny browser width and thus invoking the mobile menu button code. Now I realize that the changes to the currently active link have to be done in two places. To that end, it appears to be some code duplication, but for the sake of the introduction, it's understandable!
I prefer to use route names to generate my routes and to check for current, mostly because most of the menus i write usually have to be checked dynamically for access before rendering. But then again the means sectioning your layout into separate templates.
But i assume using the is() method is faster when you have a simpler app.
I think we are doing baby steps.... I am sure Jeffery will get to named routes eventually.
Hi Jeff
can we get Docker with lara in coming future
Does anybody knows how in the world he selects all the text from the caret location up to the closing html tag? and how deletes all the text between ' ' like 'some classes goes here' without selecting it? This guy is a magician!
Which extension you use to add cdn in file
Amazing
now if i do :active="{{ request()->is('/') }}" it is give 'syntax error, unexpected token "is('/') }}" without ":" so the last part of the video is not correct now
Yes, they changes things nonstop for reason or without it... broke stuff, problems for every little thing, considerations...
This is the reason many people stuck with one version for 5-7 years and don't want to know for the latest mega fancy feature that is presented in version 11.7.4!
u don't need the curly brackets
@@_Elfaro what do mean this is php code can you write an example to understand you thanks :;
what keys in windows. toggle word in phpstorm ?
❤❤❤
Cutest trainer ever😂
could I ask which theme and parser plugins you are using. I don't get the ligatures for the fat arrows and triple equals, nor the context highlighing with logic inside the double curly braces
Pretty sure it's a php storm thing, and not available for VS code
i can't writing "right arrow" please help me.
Dash + right angle
Please send me those (dash+right) picture.
@@mdsohelrana4557 -> type this on the keyboard sir
->
please i dont understand this episode, please could you like break it down
Can you please point out what you didn't understand, I can help give some more elaborate explanation
Please create a complete course for creating complete blog website.
So my question is...Do I want to get my hopes up and waste time getting started only to be greeted by a paywall later?
I went to the website and boom paywall. I don't have a job and I guess that means I can't afford to learn -_-
Keep learning with freebies, get a job and then pay for the premium course. Easy!
hi Jeff, or anyone here I have a question.
when I don't add @props on the nav-link.blade.php, it's still working. so, should we ALWAYS declare @props or we can leave it?
Starting with Laravel 7, the Blade component system implicitly converts all passed properties into variables, so you can just use them.
at 6:18 Jeffrey explains that: if you do not add it to @props, it will be treated as a regular attribute and, when adding $attributes to a tag, it will be included there (what is not always desirable).
@@renatofrota thanks for explaining
Undefined variable $active, I've added @props(['active']) on the top of nav-link
I typed $active->false instead of $active=false
@@jvincent4854 try this @props(['active' => false])
@@jvincent4854 type is this : @props(['active'=>false])