August 3, 2019
To understand, how dependency injection works in Laravel, let’s jsut get to know what dependency injection actually is, in software engineering.
July 22, 2019
July 12, 2019
If you want to check if the eloquoent model has certain relationship or not and fetch the results accordingly while querying upon it, you can do this by two approaches in the Laravel Eloquent.
July 6, 2019
When you’re building an Laravel application which uses APIs at some point, it’s no brainer to use Laravel’s resource classes as it provides the transformation layer that sits between your Eloquent models and the JSON responses that are actually returned to your application’s users.
June 16, 2019
Laravel’s Eloquent ORM comes with this unique set of features called “Scopes” which can be used to re-use some of the query constraints onto all the queries of a certain model. This can be useful to minimize the code while writing the query and is an easy way to make sure every query for a given model receives certain constraints.
May 5, 2019
Every robust web app has this feature where you’re provided with a setting through which you can choose to logout from all the devices you’ve been logged in from previously, except the current one. This is certainly a nice security feature that you can provide to your user without them even asking for it and if your app is built on top of Laravel 5.6, this comes out-of-the-box.
April 29, 2019
There’s this neat feature in Laravel where you can validate model IDs that have been injected into the route by injecting model instances directly at route level.
April 15, 2019
Laravel’s Eloquent is without a doubt a great ORM exists right now. It has some of the features which makes it ahead of its competitions. One such feature the ORM provides is called “Attribute casting”.
March 29, 2019
March 28, 2019
There comes a time when you want URLs which are public but still you want some kind of authentication onto the same. For instance, you’d want such kind of URLs to enable invite-only registrations for your applications, where you’d send a URL to the user which that specific person only can access and register. In such scenarios, signed URLs can come in handy which are the special kind of URLs that have a “signature” hash appended to the query string to verify that the URL has not been modified since it was created.
March 26, 2019
There exist this neat feature in Laravel using which you can add attributes in the models that do not have a respective column in your database.
February 9, 2019
While developing applications(not necessarily with Laravel), you come across the situation where you need to implement certain functionality. In such cases you shouldn’t want to reinvent the wheel if the functionality is been implemented by someone as a package, accepted well by the community and is ready to be consumed. It’s a no-brainer. I use to follow the same approach and today in this article, I’m going to list out some of my favorite Laravel packages which have made my experience with development in Laravel delicious.
January 9, 2019
When working on a project, there comes a time when you need to automate certain tasks. In such cases, it is better to use a CLI tool which can be run from the command prompt because using a web APIs for certain tasks is cumbersome.
December 21, 2018
There comes times when you wouldn’t want your end users staring at white screens or that intimidating loaders for a long time. For instance when user registers to your site, you must have configured your website to send a welcome email or a confirmation email upon registering. So, that operation should be snappy and for that purpose you’d actually want to reduce the amount of time your app takes while sending the email to the user. Laravel Queues comes to the recue for achieving such kind of time consuming tasks.
August 23, 2017
Accessors and mutators allow you to format Eloquent attribute values when you retrieve or set them on model instances. I’ll explain how you can you use them into your app.
August 17, 2017
Today, while working with one of my projects(which is built on top Laravel) I bumped into the situation where I needed to get associated model’s data for one of the models. So here, I had two approaches in Laravel to accomplish this which are basically called Eager Loading: