automica liked a comment+100 XP
2mos 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
3mos 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
3mos ago
automica liked a comment+100 XP
3mos 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
3mos 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
3mos ago
automica liked a comment+100 XP
3mos ago
automica wrote a reply+100 XP
3mos ago
automica liked a comment+100 XP
3mos ago
Great series Jeremy! Re: the currently authenticated user - I'm pretty sure that's already stored in memory so there's no point in storing it in context unless you need it in a queue job. Auth::user() doesn't make any additional db queries - Laravel only retrieves the user once (at the beginning of every request).
automica liked a comment+100 XP
3mos ago
automica liked a comment+100 XP
3mos ago
@automica Use Socialite to get OAuth tokens from other providers (i.e. Etsy). Use Passport to offer tokens to other parties, to allow them your users to authorize access to those providers.
So yes, in your case you would want to use Socialite to obtain an access token for an Etsy user. You can use this: https://socialiteproviders.com/Etsy
Once you have an OAuth token for an Etsy user, you will be able to make requests to Etsy’s API as that user.
automica liked a comment+100 XP
3mos ago
automica liked a comment+100 XP
3mos ago
There’s a lot of debate around this.
From my experience, AI significantly reduces time to production—projects that once took months or weeks can now be completed in days or hours. Refactoring is faster as well.
That said, when AI breaks down, a developer still has to understand and fix the code. I’ve heard of teams abandoning AI-generated projects because no one fully understood the codebase.
Bottom line: AI is a productivity tool, not a replacement. It can help, but it’s not a silver bullet.
Marketing is still marketing—SEO, targeting, and messaging matter. Relying entirely on AI for marketing content can be risky if it gets things wrong.
Used carefully, AI is valuable. Used blindly, it can create problems.
automica liked a comment+100 XP
3mos ago
Hiring teams primarily look for learning ability, strong fundamentals, and practical problem-solving skills—not senior-level infrastructure expertise.
To get a junior Laravel job you should build a few solid, real-world Laravel projects that demonstrate core PHP/Laravel knowledge (CRUD, authentication, validation, relationships, testing, and Git), basic SQL, and simple deployment, while understanding DevOps, cloud, and system design concepts only at a high level rather than fully implementing them.
automica was awarded Best Answer+1000 XP
3mos ago
Think of AI as a way to do what you were going to do anyway but quicker.
As AI can write code quicker, it can also ruin codebases quicker too. You can protect yourself from this by ensuring you support your code with functional tests, and also ensure you have a good version control strategy (ie learn git, commit small and often).
It's totally possible to follow test driven development strategy working with Agentic code tools. You need to stay focussed, keep a check on the outputs of your methods and continue to review your own code before you publish to production.
You should also look at writing an agents.md file to describe to your AI how your code base is structured and how you prefer to write code. My agents.md describes how my commit messages are made, how to run linting and what conventions our code base is following. This is essentially a glorified readme.md specifically targeted at AI. Be careful not to be too verbose in here though as this file is passed to your AI with every prompt so will chew through the credits.
Web developers have a great future ahead of them if they remember that they are solving problems with code, not just there to churn out code. For me it's like I've gone up a step and instead of writing code, I spend more time on the acceptance criteria, testing and planning.
Back when I started in web, we had to make html by hand. Now AI's are enabling speeding through this kind of work and now I'm able to concentrate on the quality of output and to be able to prototype quicker (and be less precious of throwing stuff away).
I can't wait to see what we're going to get next!!
automica wrote a reply+100 XP
3mos ago
automica wrote a reply+100 XP
3mos ago
Think of AI as a way to do what you were going to do anyway but quicker.
As AI can write code quicker, it can also ruin codebases quicker too. You can protect yourself from this by ensuring you support your code with functional tests, and also ensure you have a good version control strategy (ie learn git, commit small and often).
It's totally possible to follow test driven development strategy working with Agentic code tools. You need to stay focussed, keep a check on the outputs of your methods and continue to review your own code before you publish to production.
You should also look at writing an agents.md file to describe to your AI how your code base is structured and how you prefer to write code. My agents.md describes how my commit messages are made, how to run linting and what conventions our code base is following. This is essentially a glorified readme.md specifically targeted at AI. Be careful not to be too verbose in here though as this file is passed to your AI with every prompt so will chew through the credits.
Web developers have a great future ahead of them if they remember that they are solving problems with code, not just there to churn out code. For me it's like I've gone up a step and instead of writing code, I spend more time on the acceptance criteria, testing and planning.
Back when I started in web, we had to make html by hand. Now AI's are enabling speeding through this kind of work and now I'm able to concentrate on the quality of output and to be able to prototype quicker (and be less precious of throwing stuff away).
I can't wait to see what we're going to get next!!