Composer 2.0 — How to upgrade and features overview
October 26, 2020 — I’ve said it earlier and I’m saying it today as well that Composer is the backbone of modern development in the PHP landscape. It has been so much easier to pull in open-source packages into your projects which weren’t possible in the pre-Composer era.
Custom Eloquent collections to make queries more readable in Laravel
October 23, 2020 — If you’ve worked with Laravel, you might be aware of the fact that all the multi-result sets returned by Eloquent are instances of the Illuminate\Database\Eloquent\Collection
object. So, for instance, if you have a User
model, you can get all the users like so.
Insert or update multiple records using upsert in Laravel 8.x
October 20, 2020 — It would be useful sometimes when you’re not sure if you want to insert or update records and you’d let the system decide that. Laravel comes with one such feature that lets you do just that.
Convert HTML to PDF like a pro using DocRaptor API (Sponsor)
October 16, 2020 — If you’ve ever worked on enterprise-level web applications, there’s a good chance that you would have in need to convert documents from one format to another such as converting an HTML document to PDF.
How to use .env values in Laravel Envoy
October 14, 2020 — Laravel Envoy is a great tool if you want to create deployment flow for your application or even something as small as writing a script to pull the latest code and deploy the application right away.
Gracefully installing global Composer libraries
October 13, 2020 — Recently, I happened to install the Laravel Envoy library in my Linux-powered machine. Now, if you don’t know, Envoy is a task runner that can be used to define and run common tasks on your remote (and local) servers. You can set up tasks for your application deployment such as Git commands, artisan commands, and a lot of other CLI-based things.
Binding additional information to views using composers in Laravel
October 12, 2020 — You know if you want to pass data to the views, you can do it while defining routes or from controllers like so.
Extending Validator facade for custom validation rules in Laravel
October 5, 2020 — In one of my articles, I’ve explained how you can extend class behavior using macros in Laravel.
Resolving dependencies conditionally using service container in Laravel
October 3, 2020 — One of the standard ways to resolve dependencies in Laravel is by using service container. Essentially, if you want to inject something which can be swappable anytime, you can do this by “biding” that into the service container.