automica liked a comment+100 XP
5mos ago
Learn what there is to learn about lastInsertId, then if it fits the use case, use it. If it does not fit the use case, don't use it.
Just like Linux dd you have to know what you are doing.
This should also apply to people giving advice. This is NOT the place to use it. You're suggesting the wrong approach. It doesn't answer the user's question and may cause bugs now or later.
Laravel gets the last ID right after performing a query. The same method isn't guaranteed to work at the app level, and I already listed some common examples where this would break down. Even if it worked at start, later changes may break it in a way that's easy to miss.
If you need the last ID of a table for some reason, query max(id). Don't use last_insert_id() outside the ORM.
automica wrote a comment+100 XP
5mos ago
I got into this profession as I wanted to solve problems, and don't feel at all that AI is depriving me of something, quite the opposite.
We often think our job as an engineer is writing code, but really our benchmark should be how we can solve problems with as little code as possible.
The role has changed somewhat over the years, and now an engineer is as much QA and planner as they are coder. With the right plan, we have the tools to translate that into any language we want. I'm predominantly PHP but have built in VueJS, typescript, React and node and have done so because I know what I wanted and made sure the tools delivered it.
The stack overflow days were awful if we really think about it. Code copy pasta was rife with bugs and opinion. For niche questions you'd be left on a wire for weeks. What a passion killer.
Now I've gone from asking other team members for advice to being able to glean and gather information and instructions much quicker. Being able to get live code instantly has been a revolution, especially for the self taught.
The role forward for an engineer will always be to solve problems and no tooling will take that away from us. A good engineer will become a polyglot and still be able to be employable.
I use AI for every project now, from code to car mechanics, electronics, DIY. I can't wait to see what happens when the second revolution comes. Bring it on.
automica liked a comment+100 XP
5mos ago
This is the best short explanation of JavaScript Functions I have ever seen, thank you, Andre!
automica liked a comment+100 XP
5mos ago
That's it! That is exactly it. I did indeed run some tests on a feature I had added just before doing the upgrade.
Thank you so so much. This community is fantastic!
automica liked a comment+100 XP
5mos ago
what error? Go on, give us a clue!
automica liked a comment+100 XP
5mos ago
I got an error.
@oligarchcat Which was…?
This may come as a surprise to you, but we’re neither clairvoyant nor can we see your screen. So if you did get an error, you kinda have to tell us what that error was for any one to be able to even start helping you.
automica liked a comment+100 XP
6mos ago
@vincent15000 It was a full end-to-end tutorial that took people through creating a Laravel application from start to finish. But it disappeared.
It’s since been re-created, and re-launched under the new “learn” subdomain: https://laravel.com/learn/getting-started-with-laravel
automica liked a comment+100 XP
6mos ago
It is still worth following. Don't know why they removed it, but they added a link to Laracasts instead which in my opinion is the better choice anyway.
automica liked a comment+100 XP
6mos ago
If you are referring to the Laravel From Scratch 2026 and 30 Days To Learn Laravel, well they are basically the same thing, it doesn't really matter that much which one you choose. I would go with the From Scratch one.