#Undefined variable $users
35 messages · Page 1 of 1 (latest)
Where ever you are returning it, you’re not passing a $users variable to the view.
By… passing it?
The view doesn’t know what the value of $users should be unless you actually tell it.
Well I asked you how you were returning the view, you didn’t answer.
I’ve also told you the solution (you need to actually pass the variable to the view).
Mate. I can’t see your screen. I have no idea what code you have.
Please familiarise yourself with the #rules, particularly 1️⃣
1️⃣ Help us help you - Search the documentation before posting your issue and explain what you're doing and include any error messages you have received.
…
You haven’t shown a single line of code.
For the controller or route that’s actually returning the welcome view.
You have two routes that both return the welcome view. So which URL are you hitting?
Cool. That’s not what I asked though.
Which URL are you hitting, that gives you the error?
I think he is following the link that serve is giving him so we can say localhost/ and not localhost/users?!
Yeah. But I’d like to know for sure rather than just assuming 🙂
@delicate torrent did you try to add /users to the url?
Are you trying to access localhost/ or localhost/users?
Mate. What address is in your browser’s address bar when you get the error?
Well, yes. You don’t seem to understand what a URL is.
It was a pretty simple question I was asking.
You get an error. What address is in your browser’s address bar when you get that error?
Once we know what URL you’re trying to access, we know what route is being accessed. And can continue diagnosing the issue.
This has nothing to do with being “new” to Laravel.
The address. What address are you hitting when you get an error?
He is asking about your webbrowser url. Like in Chrome https://google.com
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
Cool. Thanks for wasting both of our time then.
I’m sure you’ll get far with an attitude like that.
Yeah php artisan serve is starting the webserver and gives you the url of the website inside the terminal/console but then you have opened you browser to access it like chrome, firefox, safari and there you got something like 127.0.0.1:8000/SOMETHING that SOMETHING part is the important one. If you only got ...8000/ there you welcome view is not getting anything because the first route got used.
So if you try to access http://127.0.0.1:8000/users it should work there? Try this links pls
Right. So if you are hitting just http://localhost:8000, then it’s matching this route:
Route::get('/', function () {
return view('welcome');
});
Which isn’t a controller, and isn’t passing a $users variable to the view, hence the “variable is undefined” error.
@delicate torrent Good talk 🙄
Well I’m trying to help you, and instead you’ve decided to throw a temper tantrum and also go and delete all of your past messages.
How is asking for code, or asking what URL you’re on, “for professionals only”?
If you’re going to act like a frigging baby then yeah, you’re not going to get any help from here. Go somewhere else. Absolute child.
Blocked.