I have been following Laracast 30 day to learn Laravel, everything was going great until ep5 when we started with props result in an error : Undefined variable $active
@Snapey Thanks for replay,
yes , it is php 8.3.
laraval is 11.9
as I said , this is following tutorial 30 day to learn laravel.
the code above is in nav-link.blade.php file which is in a components file with layout.blade.php where the attribute active="foobar".
exactly as the ep5 in the tutorial .
what active should be true or false? active here is a props link the attribute in anchor tag.
I have followed the tutorial closely. but it always result in laravel break with error Undefined variable $active.
@mhballa Post your code. People won't find the video and watch through it just to see what you're talking about. It wouldn't help anyway, because the bug is in your code, not the video.
The bug is that you're trying to use an undefined variable called $active. People can only help you fix it if they see your code.
Are you properly passing in the prop from the view that uses the component? Also, if you are following the video, it also has a default value of false.
So, watch it again and again if you need to, there is no penalty for that.