Unpopular opinion: using Next.js for your startup is an expensive mistake.
If you know PHP or have time to invest, do yourself a favor and start with Laravel.
@jasonleowsg
You'd think developers are rational. But they're not. Most of them take decisions based on superstitions and just parrot others without fact checking.
Just try SQLite in production and see for yourself. In case you encounter a blocking limitation, you can just move to MySQL or
Think PHP and Laravel don't scale? Think again.
OpenAI is hiring web developers like us for their main website which gets hundreds of millions of visits each DAY. 👍
Laravel developers, here's my first Livewire v3 advice.
Are you using `wire:navigate` everywhere? Improve the UX by scrolling the user back to the top of the page whenever a link is clicked. 👍
Laravel 11 is here! 🎉
4 tips for an easy update:
1. No need to hurry. Your apps won't instantly improve with Laravel 11. Remember: Laravel 10 will be updated until February 4, 2025.
2. Run "composer outdated" to see which dependencies have a new major version waiting.
3.
Indie hackers lack ambition.
That's why most fail.
"I launched X amount of products and they all failed."
OK. Let's see:
1. A boilerplate for something they never had success with.
2. A low-effort/low-interest LLM wrapper with a subpar UI.
3. A directory site like it's the
Laravel best practices: the definitive guide for 2022 ✅
It's a work in progress.
The more you'll share it, the better this guide will be. I need as much feedback as possible. 💪
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
ChatGPT is down.
I'm working with a technology I'm not an expert in.
Google is highly inefficient. 😔
I'm paralyzed.
I've been programming for 18 years. It's scary how fast I've got used to constantly interact with GPT. 😨
@tomhuntio
He will repeat the same thing in his next job. He's an entrepreneur and doesn't know it. Nothing is more annoying than working for someone else.
Web Artisan GPT.
Good idea or not? 🤔
Basically, it's been fed the LATEST documentation from Laravel, Livewire, and Filament. No April 2023 knowledge cutoff.
It can help you learn and build anything.
I could add Tailwind CSS and many others too. 👌
Are you using the new accessors and mutators in Eloquent?
Did you know the value can be cached for the duration of the request using the simple "shouldCache()" method?
Very handy when the attribute requires heavy computation (loops, database queries, etc.). 👌
#laravel
Two basic golden rules with Livewire:
1. Never forget wire:key in loops. ✅
2. Manage items in the parent component if you extracted them to a child. That way, reactivity is effortless. ✅ ($parent is your friend.)
90% of problems solved.
Here's the great news: soon, I will produce content for our beloved
@Laracasts
!
I'm going full circle here, because this is where I started learning Laravel in 2015. I'm super happy to contribute. 🙂
This single component can turn your Laravel app into something that feels like a SPA when using Livewire v3.
Combine that with the tip I shared two days ago. 👍
So, I've been bitten in the ass by some convenience method Laravel offers.
My SaaS was down for ~30 minutes yesterday because I was so tired I couldn't figure it out.
In Laravel's migrations, you can use the foreignIdFor() method to avoid setting the column's name yourself.
Keep your Laravel projects in check with my updated list of best practices. 🔥
Discover actionable tips to improve your codebase without added complexity. 👍
Discover 20+ up-to-date Laravel best practices on my blog.
1. Use factories for fake data and testing.✅
2. Stick to the default folder structure unless forced to do otherwise. ✅
3. Use Eloquent’s strict mode to prevent performance issues and bugs.✅
Link below. 👇
7 things you can do right now to improve your Laravel codebase:
1. Write a simple test using Pest. ✅
php artisan make:test HomeTest --pest
it('works', function () {
get('/')
→assertOk();
});
2. Format all your files using Pint. ✅
composer install laravel/pint
I always loved looking at codebases that generate value.
This is why my blog is now open-source! 🥳
I launched it almost a year ago and scaled the traffic to more than 20K monthly visits. 🚀
Link to the repository below! 👇
Don't underestimate Laravel's HTTP client convenience.
Here's how to set the timeout and even retry your request if you're dealing with an unreliable service.
Livewire v3 Coding Assistant
Coming next week on the GPT Store.
Say goodbye to outdated knowledge and hallucinations! 🔥
And expect other very useful GPTs tailored for Laravel developers…
Laravel raising funds is great for the future of the ecosystem.
BUT.
Don't be fooled.
What you've heard and read so far is just corporate speech and "politically correct" stuff from rock star friends, the Laravel Elite, or news.
Laravel is indeed stronger now as long as the
From my experience, this is one of the best way to stabilize a legacy Laravel codebase:
1. Fix the code style. It's essential to bring some order in chaos. This requires good communication with the team, though. Because Git conflicts are a nightmare.
2. Create missing
A new debug bar for Laravel is in the making and here are more details.
Here's why I'm doing it:
1. Existing debug bars in the PHP ecosystem are mostly based on the PHP debug bar (like Barry's) or Symfony's profiler.
2. While these facilitate debugging, the developer
My blog (+20K visits/month) goes open source tomorrow.
- I cleaned up the code. ✅
- Improved the Atom feed. ✅
- Added AI-based features. ✅
- Switched to Livewire v3 + Volt. ✅
Here's a demo of me generating a teaser that encourages users to click when in the Atom feed:
Laravel developers, what team are you? 💪
1. PostController
2. ListPostsController, ShowPostController, CreatePostController, StorePostController, EditPostController, UpdatePostController and DestroyPostController
Not relying on a LLM in your code editor?
That doesn't make you smarter.
All the opposite actually.
You're actively refusing to increase your productivity and buy your time back for the sake of outdated habits.
Because at the very least, a LLM helps you write tons of
Announcement for all Indie Hackers:
I made a SaaS boilerplate! 🔥
It costs you $0 and it's open source! 😱
Use it right now like so:
laravel new your-sass-app --api --jet --teams
cd your-sass-app
composer require laravel/cashier-stripe
PHP needs more workforce. We'd all love to see a massive rebrand.
But no VC firm will drop them $57M. PHP isn't profit-driven. They'd lose it all.
This is why things don't move fast and likely never will.
(I have no idea if The PHP Foundation will ever be able to help.)
With time, most Laravel projects go to shit. 😬
After years of consulting, I noticed the same pattern and leading causes.
1. The owner only hires juniors
2. Juniors overthink everything while lacking essential knowledge
This thread will be of extreme value to you. 🔥
Here are 6 reasons why your Laravel codebase is a pain to work with:
1. Incomplete migrations, no factories, and no seeders. You shouldn't have to rely on production data. Laravel's documentation on these matters is super simple to understand, so go for it!
2. No automatic code
Avoid breaking things on your Laravel app: ⚠️
Livewire dynamically generates its JavaScript file.
Therefore, make sure you prevent Nginx from interfering whenever you do custom stuff on static assets (like setting the Cache-Control header).
The new version of my blog is live! 🎉
It's using Laravel, it's ultra fast thanks to Livewire v3, it looks good, it has great content, it will unlock new growth opportunities, and…
It's still open source! 🔥
I think my 20,000+ readers will love it, and you too!
I wouldn’t go another way to organize tests in Laravel projects. It makes it clearer which parts of the app are tested or not. 👍
Here’s my PHPUnit configuration if you’re interested:
All this works great combined to `php artisan test --coverage`. ✅
I'm back on the market for a job and I'd appreciate reposts, thanks! 💪
I'm full-stack Laravel with 10+ years of experience.
I have many strings to my bow, making me valuable to growing startups.
Remote or London area (if you can sponsor a visa).
Some Laravel developers started using DTOs instead of custom form requests.
Did you? Because I'm thinking about it. 🤔
Spatie even has a package for that (spatie/laravel-data). 👌
For anyone having a 404 after installing Laravel Pulse, here's a potential solution:
You may have a wildcard highjacking the `pulse` route.
The fix is simple, but good luck writing that by yourself. Thank you Copilot! (More details below.)
There's a reason why Laravel Herd works so well:
1. Docker is complicated. Nobody wants to invest time in something that doesn't fundamentally make them better.
2. Most people are not Mac users, so the ease of setup you get with Homebrew and Laravel Valet is unreachable. And
We have absolutely no idea when PHP 9.0 will be released.
But who cares? Let's start ranking for it now (and I noticed people are already searching for 9.0).
When I started learning web development in 2006:
- IE6 ruled the world.
- PHP 4 was widely used.
- We used "DHTML" to add falling snow.
Some would argue that it was a simpler era. But I think it's debatable.
Confession: I haven't used a GraphQL API even once.
I have no idea how they work or how to build them.
I'm not against it, I just didn't have any valid use case for now. 🤷♂️
Best Laravel tips for enterprise projects:
- Stick to the default structure ✓
- Write tests to help your team change code safely ✓
- Defer as much work as possible to Laravel because your talent is required elsewhere ✓
Breaking any of these should require solid arguments.
This morning, I noticed someone tried to inject SQL into the wildcard route of my blog (/{post:slug}) because the error messages where reported on my Sentry.
Here's the query that resulted (the blog looks for redirection rules first):
select * from `redirects` where `from`
Facades in Laravel in a nutshell:
1. You → Facade::foo() → __callStatic() → Container → $instance→foo()
2. When called without import, that's thanks to class_alias().
That's it. No wizardry. No true static call.
It's just clever and have proven records of helping. 🙂
Barely standing on my feet with my eyes open. 🥱
Worked all weekend with almost no sleep last night and had to catch a flight for 7 AM.
It was worth it, though. The blog has great content, plenty of traffic from Google and looks awesome. 👍
Here's how I screenshot a sponsor's homepage automatically:
- I use Browsershot from
@spatie_be
.
- I wait 3 seconds for animations to be complete and everything to load and appear.
- I get rid of any freakin' cookie banner that could ruin the screenshot by using long shot
Your onboarding sucks.
99% of the time, this was true on the countless freelance gigs I had.
And I'm angry.
Here are 6 tips to improve any Laravel project:
1. Document every step to setup the project (in a readme, not a knowledge base).
Clone it and set it up from scratch.
Here are some breathtaking changes coming to Laravel 11. 🔥
1. A slimmer app skeleton thanks to a minimal app directory; no config files, no visible middleware, no service provider besides AppServiceProvider, etc. Even ./artisan and ./public/index.php have been cleaned up!
2.
Earlier today, I asked people about their favorite transactional email service.
Here's the list from the replies I got, including some I found by myself (I'm still undecided by the way, haha):
- Resend
- Postmark
- SendGrid
- Mailcoach (It's from Spatie, and they also handle
I realized something that could change the lives of thousands of developers:
ChatGPT can write REST APIs documentation now. 🤯
Here is the basic prompt with minimal information.
I just showed the Laravel code.
The parameters are inferred. You can just focus on coding now.
Filament v3 is a blessing for the Laravel community. 👌
I feel like the possibilities are endless and I only scratched the surface. 🤯
For now, I'm just revamping the admin of my blog, but I will certainly explore more of it.
The new debug bar for Laravel is getting even better.
Now with vertical navigation, which is the better choice.
Getting the UI right is so important. It's the foundation. And it's the weakness of other debug bars across many languages and frameworks.
I'll have more to share
Laravel 11 is coming soon.
3 things you can do for a painless upgrade:
1. Don't rush it. Laravel 11 won't suddenly make your apps better.
2. Make sure the third party packages you use support it. (Go on Packagist and check for ^11.0 version constraint.)
3. Write tests. Lots
One of the best things I discovered recently in Laravel is the request()→routeIs() method.
It supports infinite parameters and wildcard names so you can do request()→routeIs('foo.*', 'bar.*')
My blog's revamp is almost done. It's going to be great with Laravel, Livewire v3, Volt, and Filament. Also fast as hell! 🔥
And remember, it's open source. Checkout the develop branch and see it for yourself. The code is a hell lot better, while still simple and tested.
By the way, did you know that my Laravel-based blog is open source?
For a reminder, it's growing and generates more than 30,000 monthly visits. 💪 And that's something you can see for yourself because the analytics dashboard is publicly accessible.
I released its source code in
You just have to accept it.
Any lasting codebase making money will be a huge mess, no matter what you do
Laravel, no-Laravel, DDD, no-DDD, using this trendy design pattern, not using it, etc.
As a team leader, your goal is to make sure that:
- intent is documented
-
Laravel developers.
Artificial intelligence is just a REST API call away.
No need to train a model with a gazillion amounts of data using thousands of GPUs.
How mind-blowing is it that? 🤯
Here's how to create a spam detection system:
Laracon 2023 started, and you better believe I'm ready to write tutorials for all the new things that will be announced. 💪
- Laravel 11 Preview (I already wrote about this, though)
- Laravel Folio
- Laravel Herd
- Laravel Prompts
- Laravel Volt
- Livewire 3
Let's do this! 🚀
Laravel developers, here are 3 crucial Livewire tips (+ 1 bonus):
1. Always use wire:key in loops. ✅
2. Sub components also need wire:key when inside a loop, no matter how nested! ✅
3. When you forget wire:key somewhere, Livewire is actually telling you! ✅
Open your
I already wrote an article showing you how to use Bun in any Laravel project.
You will see how straightforward it is to replace NPM, pnpm, or Yarn.
Link below! 👇
Laravel has tons of abstractions to help you keep your code structured.
Why not leverage them before you create yours? Try hitting the framework's limits first.
Examples:
- API resources
- Events
- Factories
- Form Requests
- Listeners
- Mailables
- Middleware
- Notifications
-
Who needs a reminder about how Facades work in Laravel?
You → Facade::foo() → __callStatic() → Container → $instance→foo()
So yeah, no true static call, and perfectly testable. ✅
And did you know why Facades also work when not imported? For instance:
Cache::flush();
It
DDD is overkill for most Laravel projects.
A good way to keep them organized is to leverage Laravel's features and magic. 🔥
1. Use policies
2. Use custom requests
3. Extract logic to services
4. Use single-action controllers
5. Register your services in the container
👇
Scraping data from websites is such a nightmare:
- You have to write code for each piece of information. 😅
- Some sites have raw HTML without specific identifiers. 😨
- Others even have randomly generated identifiers like "du4iok". 😭
- Any change to the DOM, and you have
Another week, another call for freelance work. 👋
I still have open slots for Laravel-related gigs.
If you are serious and have an immediate need for a veteran full-stack Laravel developer, drop me a DM! 💪
Anything that boosts this post is appreciated! 🙏
GPT-4 strikes again. 🔥
I managed to automatize one of the most annoying things Laravel developers have to do.
Internationalizing a project by wrapping up strings in the __() helper across dozens of Blade templates.
What a relief! 😮💨
Adding chat capabilities to
@laravelphp
's documentation must be tough, right?
Actually, it's gonna be super easy, barely an inconvenience. 😎
Should I release this? This is so handy.
Livewire v3 is almost there and I'm super hyped! 👌
Keeping Laravel projects simple is not possible by adding Vue.js or, even worse, React. Livewire fixes this issue.
What's your favorite feature of v3? To me, it's the persist directive. 😍
Using PHP, let’s build the basis for an automated job offers aggregator powered by AI.
We’ll be using the OpenAI PHP client from
@enunomaduro
,
@gehrisandro
and Mantas Smilinskas.
🤖
I just wrote a super informative piece about PHP 8.3's new Override attribute.
If you didn't understand it before, there's no way you still won't after reading my article.
Link below, enjoy! 👇
For web apps, unit tests are mostly useless. ✋
It's easier to write them, they're fast, and it feels productive. But code doesn't run as isolated pieces in production.
Write feature tests!
I guarantee you'll have less regressions if you start now. 👍
Just woke up to a video of Povilas reviewing one of my articles about testing best practices in Laravel.
This is GREAT. The feedback gave me ideas on how I could improve it!
Use ⌘⇧P to navigate in the new debug bar for Laravel. And it supports fuzzy search too! I had to do this.
I don't use any UI components library. Just Blade, Alpine.js, and Tailwind CSS. By far my favorite stack for frontend.
Filament is great.
BUT.
It's a real time sinker.
So here's how I make my life easier using Claude 3.5 Sonnet as a Laravel developer:
1. Ask Claude to create a bash script that concatenates all Markdown files from the documentation (it's open source on GitHub, just clone the