🚀 I’ve tagged 1.0 of spatie/laravel-pdf
🔥 This package can create PDFs from Blade views
🎨 You can use modern CSS syntax and frameworks like Tailwind to style your PDFs.
🧪 Comes with a fake so you can easily test code that generates a PDF
😍 Lots of Laravel niceties
Confession: I grew up pretty poor.
My parents didn't have money to take me on any vacations abroad. Or even within Lithuania to the Baltic seaside.
Now I'm sitting in a lobby of a marvelous hotel in Malaga where I can afford to take my children.
Amazing feeling of achievement.
Coding has different ways of doing the same thing but it is good to follow semantics.
Code below works, but the logic is better off on a Gate/Policy than a Rule/Validation. Reason being; semantics. You're testing against a user's authority rather than a data's validity. #laravel
After 3 hours of debugging a cron trigger not running properly, I've asked ChatGPT. Given him some portions of the code and it solved the issue in 30 seconds...
@PovilasKorop@debiprasad Hot take: there are people who love to code... and people who just code as a job.
I have encountered so many scenarios where I can tell which they are depending on how they write their code.
Working with a project using Node/Express/MongoDB.
I would HATE myself if I ever shun the opportunity to explore other technologies and even more so if I ever get into x-is-better-than-y mindset, but I do miss the #laravel ecosystem.
This bit of prop has saved me from the issues of working with RN's FlatList methods while dev'ing a gallery component.
Since the offset of the items is declared ahead of time, scrollTo* methods work seamlessly.
This is why I hate coding exams that rely heavily on syntax.
Also, coding interviews are too concerned about sorting an array in reverse order based on the moon's gravity at the given date output when you multiply a cow's milk by the total population of Greed Island in HxH.
There's no obvious way to sort #laravel's model collections through its loaded relationships, so I usually do a join and sort the relationship columns from there.
One of the importance of knowing SQL queries outside ORMs (even though the implementation is still through ORMs).
@LFCsince2005 @PovilasKorop Good idea. Although correct me if I'm wrong, wouldn't that just paginate the parent model (Category) instead of the eager loaded relationships?
In a #laravel project, you are tasked to return a specific JSON structure from an endpoint. The table is structured below.
Do you query and..
A. Format those results in your service/action classes
B. Pass the results to an API resource class and do the formatting from there.
@PovilasKorop That works with a regular query excellently, but when modifying the returned data you lose the meta, links and data keys from the pagination.
Modifying from the resource "collection" (single objects is okay) classes not very straightforward too - hence the tweet!