I finally feel comfortably enough to call myself a developer. It has taken lots of projects and getting over impostor syndrome to do it, but I'm there now.
PHP tip.
Use `sprintf()` if you want to generate some numbers in specific sequence, with leading zeroes.
Example of hotel room numbers like 101, 102, 103, etc.
Hey Laravel Developers 👩💻
What if you get a requirement that you don't want your users to be logged in from multiple devices simultaneously?
Do not worry; Laravel makes it pretty easy to implement such functionality.
The Auth facade comes with a logoutOtherDevices() method which you can use to immediately logout the users from other devices as soon as they log in to the current device.
Here is an example code snippet for the same...
#laravel #php
The official Laravel VS Code extension is now available in beta.
✨ Blade syntax highlighting
🖊️ Eloquent autocompletion
🔗 Route, config, & middleware linking
🧠 Smart diagnostics
And more...
Get it now → https://t.co/M7svNXCJGi
📣 I got news 👀
In February 2025, I am joining @laracasts as a full-time instructor 🎉
I'll be teaching you Tailwind, React, frontend stuff and probably a lot more.
Going back to my true calling — creating high quality developer screencasts 5 days a week ❤️
Here's a Laravel tip that's not well documented.
I learned it directly from OpenAI's o1-mini model, actually:
You can sort records using a relationship's column maximum value in an Eloquent-friendly way.
Use case:
Let's say you have products.
Each product has reports.
You want the first product in the list to be the one with the most recent report.
Well, that's one way you can do it. There's only one mention of withMax() in the documentation without any example.
Laravel Tip 💡: A Better Pluck
We often need to get the IDs of some models. While you can use the "pluck()" method to do this, you can also use "modelKeys()", which reads better and won't break if you change the primary key at any point 🚀
#laravel
Hey Laravel Developers 👩💻
A common scenario in programming is assigning a value to a variable based on a condition or otherwise setting it to null.
Typically, we define a null variable and then assign the actual value inside an if statement.
In Laravel, we can simplify this with the when() helper method, which takes a condition and a callback function as parameters, allowing us to handle this assignment logic in a single statement.
#laravel #php
Introducing: API docs!
Now there’s a dedicated place to view all properties, methods, and classes in Filament.
This is just the beginning, so expect updates and improvements as we add more details to each of these methods and properties over the coming months.
Link in reply!
I'm trying to make a modern debug bar for Laravel.
It's a super early concept, I have innovative ideas to try that will make the debug bar a true coding companion.
I'd love to share more later if anyone is interested.
For now, I'm just trying to improve the UI by reimplementing the basic features everyone, no matter their level, needs.