Quick tip - Using lightweight pagination in Laravel
April 4, 2021 — If you want to paginate database records in Laravel, you can use the paginate
method on the query builder or an Eloquent query.
The prohibited validation rule in Laravel 8.x
March 30, 2021 — Sometimes, all you would need is to forcefully prevent some of the fields in the request. Essentially, to “prohibit” or ban the fields to be mandatorily empty or not present in the request at all.
Cleaner exception handling using rescue() helper in Laravel
March 22, 2021 — If you want to make your web application robust, you get to handle those quirky and unpredictable exceptions. And the way you do that in PHP is by using try-catch blocks in your code. The same applies in the case of Laravel as well.
Seeding model rows based on the user input in Laravel
March 15, 2021 — Oftentimes, it would be handy if you could seed the number of model rows based on the user input. i.e you don’t hardcode the number of rows a seeder would generate. The user will pass that number while running the seeder.
Dry running Laravel migrations before actually migrating them
March 11, 2021 — Sometimes, you might run into a situation where you want to see what all database queries will run upon running your Laravel migrations, and that too without actually running the migrations.
Retrieve HTTP response as a collection in Laravel 8.x
February 27, 2021 — Sometimes, when working with HTTP responses, you might want to retrieve the entire response as a Laravel collection to make further manipulations.
Adding lines conditionally in Laravel's Mail notifications
February 23, 2021 — When working with Mail notifications in Laravel, you’ll often be in a situation where you would want to render something based on some condition.
Mutation-free JSON column updation using AsArrayObject Eloquent cast
February 21, 2021 — If you have worked with a Large scale Laravel application, there might be a great chance that you would have to use JSON columns to save some information in your tables.
Tappable and pipeable fluent strings in Laravel 8.x
February 7, 2021 — The fluent string operations were introduced back in the release of Laravel 7 which offered a more object-oriented, fluent string manipulation library built on top of Illuminate\Support\Str
functions. To use this fluent API, you’d need to use the Illuminate\Support\Str::of
method which creates a fluent Illuminate\Support\Stringable
object.
Retry operations with high probability of failure in Laravel
January 24, 2021 — There are certain operations that can have a high probability of failure. For instance, sending a request to a third-party API. You’re not sure whether it will work every time flawlessly because it’s not in your control. If the API endpoint you’re hitting is not responding, you might end up with an exception straight away.
The query builder's sole() method to validate multiple records in Laravel 8.x
January 21, 2021 — With the latest release minor of Laravel, i.e. v8.23.0, a really interesting method has been introduced in Laravel’s query builder for situation where you want to get the only record for the matching criteria. But if there are more records for this criteria, there should be some sort of exception.
A little known artisan command that can inspire you
January 19, 2021 — While working on your codebase, be it developing features for your application or fixing bugs, we all tend to get a little bit demotivated sometimes in the middle of those sessions. Because after all, we are all humans and we all need some kind of inspiration every now and then.
How to prevent overlapping of jobs in Laravel
January 18, 2021 — When you are using Laravel queues, you might bump into the situation where you want to prevent overlapping of jobs that handles sensitive information. This could be to provide data integrity of important information such as the user’s wallet balance.
Artisan command to use model instance in controller actions in Laravel
January 11, 2021 — Here’s a little tip about the artisan command that generates the controller. So, if you’ve used the make:controller
command with the --resource
option, it will generate controllers with create, read, update, and delete (“CRUD”) actions in them.
Aliasing polymorphic types in Laravel's Eloquent
December 30, 2020 — When working with polymorphic relationships in Laravel’s Eloquent, it’s important to specify the “type” of the related model. You can do this by using morphOne
, morphMany
, and morphToMany
methods.
List scheduled commands in CLI in Laravel 8.x
December 16, 2020 — Sometimes, it would be convenient if you get details regarding things right in your terminal. Take for instance, all your scheduled commands that you have defined in your application’s App\Console\Kernel
class’ schedule
method like so.
Monitor a Laravel App with Scout APM (Sponsor)
December 15, 2020 — There is no denying the popularity of PHP. It has been a constant force in the web development world since its release in 1995. And now, thanks to Laravel, it is still going as strong as ever!
Delaying notifications channel-wise in Laravel 8.x
December 14, 2020 — Up until now, if you would need to delay notifications, you could do it by chaining the delay
method onto your notification instantiation like so.
Get up and running with Laravel blazing fast using Sail
December 9, 2020 — Imagine you just bought a new computer and the next thing you want to do is create a brand new Laravel application in your brand new machine.
Execute code outside of transaction only when it commits in Laravel 8.x
December 3, 2020 — Sometimes, there might be a case where you would want some of the code that lies outside of the transaction to be executed only when the corresponding transaction commits successfully and if in any case, it’s a rollback, that code shouldn’t be executed.
Artisan command to connect to the database in CLI in Laravel 8.x
November 25, 2020 — Laravel keeps getting better on each of its major releases. But sometimes, it’s the minor and patch releases that take the cake by introducing some lesser-noticed features.
Throttling submission of form in Laravel
November 22, 2020 — You might face a scenario where you’d want to restrict a user from submitting a form within a certain time limit. i.e to prevent spamming by users.
Monitor logs in Laravel Telescope in production environment
November 18, 2020 — The Laravel Telescope package is great for debugging your application when you’re working on your application in the local
environment. It provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps, and various other things in this beautiful interface.
Using MySQL explain for queries in Laravel 8.x
November 16, 2020 — MySQL’s EXPLAIN statement is a handy tool if you want to take a quick glance over queries and to make out what’s wrong with them. Essentially, EXPLAIN
is used to obtain a query execution plan (that is, an explanation of how MySQL would execute a query).
Simple and lightweight scaffolding using Breeze in Laravel 8
November 11, 2020 — When Laravel 8 released, It came with a lot of new features & improvements but along with it, the Laravel team has also introduced Jetstream for application scaffolding which comes with all the bells and whistles in-built such as login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management.
My first PR in laravel/framework that got merged!
November 9, 2020 — Alright! So, my first PR in laravel/framework has got merged and I’m on cloud 9 right now. I’m not kidding!
Loop over and include Blade views simultaneously using @each in Laravel
November 6, 2020 — Sometimes, there comes a scenario where you want to loop over a collection or array and include Blade views based on the iteration of that collection/array. You can use @foreach
and @include
for this purpose but there’s a handy way using which you can simplify this process.
Generate temporary URLs of AWS S3 files in Laravel
November 2, 2020 — Sometimes, all you want to do is generate temporary URLs for files that you have stored on your AWS S3 bucket. For instance, you would want to use this to prevent hotlinking of images.
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.
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.
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.
Laravel Ecosystem Jargon
September 24, 2020 — Laravel, as a framework, has grown slowly but strongly since its inception and so is its ecosystem. The ecosystem here is all the packages/products that are built by the Laravel team which revolves around the original Laravel framework. This includes open-source packages and premium/paid products.
Catchable queued closures in Laravel 8
September 23, 2020 — One of the handiest features of Laravel is the ability to dispatch Closures to queues. This is because you don’t always need to create a job class for simple tasks such as sending emails.
How to use Laravel 7.x model factories in Laravel 8
September 18, 2020 — Laravel 8’s class-based model factories are great and I’ve written an entire article about what they are and how they are more feature-rich and useful than the traditional factories that we used to write prior to Laravel 8.
How to use Laravel 7 style controller route definitions in Laravel 8
September 16, 2020 — One of the most prominent changes in Laravel 8 is the (kind of) new way of defining controller routes. Before Laravel 8, if you wanted to define a route, you could do it like so.
New RateLimiter facade for defining named rate limiters in Laravel 8
September 14, 2020 — In the previous versions of Laravel, up to 7.x, when you wanted to rate limit certain routes, you could do it by assigning the throttle
middleware to the route or group of routes like so.
Class based model factories in Laravel 8
September 12, 2020 — The model factories in Laravel are a great way of seeding some fake data in the database for testing purposes which I’ve discussed in this article. While the previous implementation was great, Laravel 8 has given model factories a major overhaul and it makes them even better!
Access application in maintenance mode using a secret token in Laravel 8
September 11, 2020 — Apart from adding support for customizable maintenance mode views, Laravel 8 has also simplified the process of accessing the Laravel application in the maintenance mode.
Personalized maintenance mode views in Laravel 8
September 10, 2020 — When you put your Laravel application on maintenance mode using the php artisan down
command, the default view for the same looks like following.
Dynamic blade components in Laravel 8
September 9, 2020 — With the release of Laravel 8, you can now render Blade components dynamically using a built-in component called dynamic-component
.
Re-usable Blade components for Laravel projects using Blade UI Kit
September 3, 2020 — Recently, a prominent member of Laravel community, Dries Vints, has pre-released a pretty exciting open-source project called Blade UI Kit.
Refactor related macros to classes using Mixins in Laravel
September 1, 2020 — In one of my articles, I’ve described how you can add different behavior to some of the classes in Laravel using macros. To give you a primer, Laravel ships with this trait called Illuminate\Support\Traits\Macroable using which you can add additional methods to the class in hand (which is using the Macroable
trait) at run time.
Using simple yet effective caching for Laravel queries
August 26, 2020 — You know it’s always a good idea to have something at your disposal using which you can improve the performance of your applications. When it comes to web applications, one of the many things that power them is database queries and that’s why it’s no surprise that you may want to optimize those and make your application a little faster!
Define relationships outside of Eloquent models in Laravel
August 24, 2020 — You might be aware of the typical way of defining model relationships in Laravel Eloquent. i.e inside of the models itself.
Fetch count of records for children relationships in Laravel Eloquent
August 20, 2020 — There comes a time when you want to fetch the number of records for a child relationship along with the main Eloquent query.
Insert mass database records using model factories in Laravel
August 17, 2020 — One of the many ways using which you can insert records (or seed your database) is by using the seeder classes which extend a base class called Illuminate\Database\Seeder
in Laravel.
How to group where constraints in Laravel Eloquent
August 10, 2020 — When writing MySQL queries, if there are more than two where conditions, you’d want to group certain constraints/conditions to avoid unexpected behavior. For instance, check the following query.
Set default value for attributes in components using @props directive in Laravel
August 8, 2020 — As I described in this article on how you can create anonymous components in Laravel, we can create an <x-alert>
component with the following content.
Check for the application environment in Laravel views
August 5, 2020 — Often you’d come across a scenario where you’d like to check the application environment and based on that you’d like to render things.
Creating your own custom conditional directives in Laravel Blade
July 31, 2020 — Laravel’s Blade template engine is great and ever-evolving. There are some features in Blade, which if used appropriately, can make your codebase look more organized and recognizable.
Check if the specific service provider is loaded or not in Laravel
July 20, 2020 — Sometimes, you want to load some stuff based on the fact that the certain service provider is loaded in the providers
array of config/app.php
or not.
Tracking model attribute changes in Laravel
June 18, 2020 — Sometimes, it’s useful to know if somethig has been changed in the model since it’s been loaded. For instance, you would want to check if the is_published
attribute of the Post
model is set or not before publishing the post further.
Find the extension of files without extension in Laravel
June 11, 2020 — It’s helpful sometimes when you have a file and it doesn’t have extension attached to it but you want to know the extension of the file regardless.
Conditionally validate request fields in Laravel
May 28, 2020 — The usual way of validating request attributes in Laravel is by making Illuminate\Support\Facades\Validator
instance with your static rules that never change like so.
Validating Laravel requests using rule objects
May 20, 2020 — Laravel comes with a multitude of ways to validate request parameters. For instance, you could use Illuminate\Http\Request
’s validate method where you can specify all the fields that you would want to get validated inside controller’s action. You can do it like so.
How to pull a composer package in a Laravel project locally
May 7, 2020 — Lately, if you’ve been working on some functionality and you want to extract it as a Laravel package, you’d like to first test it locally. And if everything is well and good, you’d then publish it to the packagist.org.
Using custom class as a Facade in Laravel
April 29, 2020 — Facades, in Laravel, is basically a way of using Laravel’s classes without injecting them into the constructor of the class in which you want to use them.
Create your own custom Blade directive in Laravel
April 27, 2020 — Laravel Blade comes with many in-built directives such as @section
, @yield
, @parent
, @json
and several others, all of which have a certain purpose attached to them.
Auto discovery of events in Laravel
April 26, 2020 — In this article, I’ve written about how to use event subscribers or observer pattern in Laravel.
Listen to multiple events in a single class in Laravel
April 24, 2020 — The Observer design pattern is one of the twenty-three well-known “Gang of Four” design patterns that describe how to solve recurring design problems to design flexible and reusable object-oriented software, that is, objects that are easier to implement, change, test, and reuse.
Using different mail drivers dynamically in Laravel 7.x
April 23, 2020 — Sending emails in Laravel is a breeze. All you have to do is, configure your default mail service in config/mail.php
and it’s related configuration in config/services.php
file.
Named slots in Blade components in Laravel 7.x
April 14, 2020 — The new Blade components in Laravel 7 are great. They provide an easy way of defining blade components in a Vue-like tag aliases. One of the nice features of Blade components are slots.
Merge attributes in blade components in Laravel 7.x
April 7, 2020 — Blade component tags are a useful additions to the latest version of Laravel i.e. version 7. In Laravel 7, Blade components have been overhauled to allow tag based rendering, attribute management, component classes, inline view components, and more.
Reordering the sort order on queries in Laravel 7.x
April 2, 2020 — Often times, there comes a sceanrio where you’d want to alter the column through which you’ve setup your query to be sorted from. So, for instance, you’ve the following query.
Custom validation rules and messages in Laravel form requests
March 18, 2020 — If you want to validate request fields in Laravel, you could use Illuminate\Http\Request
’s validate method where you can specify all the fields that you would want to get validated inside controller’s action. You can do it like so.
Customizable artisan stubs in Laravel 7
March 12, 2020 — Artisan commands in Laravel are truly a blessing. I mean you could create just about any files be it controllers, models, middleware, provider by knocking a simple command from the CLI. For instance, if you want to create a model named Post
you could just fire the following command…
Fluent string operations in Laravel 7
March 10, 2020 — Laravel 7 has been a major version that’s been released last week and it comes with the host of features and improvements to the Laravel framework. One of the improvements being the new fluent string operations API. The goal of these API is to provide more flexibility and readablity to the regular string operations in Laravel by chaining array of string manipulation methods.
Route model bindings using custom columns in Laravel 7
March 5, 2020 — I’ve discussed about Route Model Bindings of Laravel in length in this article previously. If you’re not aware about the feature, I’d recommend you check that article first and come back here again.
Using whereNull and whereNotNull in Eloquent Collection in Laravel
February 26, 2020 — Working with Laravel Eloquent, we always had this ability to check null
fields when builing queries on models. For instance, if you want to check if email_verified_at
field is null
or not, you’d check it like so.
Convert request parameters to boolean in Laravel
February 16, 2020 — Sometimes, you might want to convert some of the request parameters to boolean. For instance, take a checkbox field. Unless and until, it hasn’t been checked it won’t be passed through to the request. In such a case, it would be beneficial to convert such inputs to boolean.
Add view within another view in Blade Laravel
February 6, 2020 — Sometimes, all you need to do is to add a Blade view into an another view. For instance, when you want to add JavaScript and CSS files as a separate Blade files which will contain the related content respectively. So, maybe you’ve a JavaScript blade file called view-js.blade.php
which wraps the JS code within <script>
tag and a CSS blade file called view-css.blade.php
which wraps the CSS code within <style>
tag. And all you want to do is add these to an another blade file called view-show.blade.php
.
Global view data for all actions in Laravel Blade
January 30, 2020 — Laravel’s Blade is a great templating system that blends with Laravel’s ecosystem very well. Setting some data to the view is a breeze and rendering those data into the template is ever so easy. For instance, if you would like to share some data from a controller’s action to a view, you’d do like so.
Add additional attributes in request in Laravel
January 29, 2020 — Sometimes, you might want to attach additional attributes to the original request that has made to the Laravel application. For instance, you want to put your own check in the middleware to see if the user is permitted to access the page or not, and pass that “check” by attaching it as an additional attribute to the request.
Identifying even and odd iterations in Laravel Blade
January 23, 2020 — When designing UI elements such as zebra strips in the tables, you’d need to identify if the loop iteration is even or odd and based on that you’d set the backgroud color of the row.
Authenticating certain controller methods in Laravel
January 22, 2020 — There are basically two ways of using the auth
middleware to authenticate the routes in Laravel.
Check unless condition in custom if blade directive in Laravel
January 20, 2020 — Laravel’s Blade::if()
method already comes with the following directives in order to check various conditions in blade template files.
Using objects as arrays (with a real world example) in PHP
January 15, 2020 — Sometimes, it’s convenient when you could get to access class objects as arrays. For instance, the time when one of the class properties is of type array and you want to manipulate it just like you’d do with an array without exposing it during object creation. I’ve included a real world example of where this could be useful, at the end of the article. So, read on!
Validating dependent attributes in Laravel request
January 9, 2020 — There comes a scenario in your app where there are some fields in your form that are dependent on an another field’s state.
Refactor eloquent queries using higher order messages in Laravel
December 12, 2019 — The best thing about working with Laravel is finding an alternate way to do same old boring stuff every now and then. I came across something called as “Higher Order Messages” while working with Eloquent recently. The feature has been in Laravel since its v5.4.
Attach, detach and sync many-to-many relationships in Laravel
December 1, 2019 — There exists four types of relationship associated between models/entities. And they are: One To One, One To Many, Many To One and Many To Many. We’re specifically going to talk about Many To Many relationship and most importantly attach
, detach
and sync
helper methods that are provided in Laravel in this article.
Drop tables, types and views using wipe artisan command in Laravel 6
November 6, 2019 — If you’re looking for a quick way to drop all the tables, their types and views and if you’re using Laravel 6.x, you can use this little artisan command called db:wipe
in order to do the same.
Extending class behaviour in Laravel using Macros
November 2, 2019 — In this article, I’m going to discuss about the feature in Laravel using which you can extend the functionality of certain Laravel’s core classes without even touching the original codebase. Or in other words, adding methods to the class dynamically.
Adding password confirmation on certain routes in Laravel
October 9, 2019 — If you’ve used some well creafted web application, such as GitHub for instance, you might’ve noticed that upon saving sensitive information such as settings or payment details, it asks for the password confirmation before performing the action. This adds the extra layer of security and certainly a nice-to-have feature.
How to utilize Capsule to use Eloquent ORM outside Laravel
September 11, 2019 — If you love the Laravel as a framework or more specifically its Eloquent ORM like I do then there’s a great chance that you’d like to use this great ORM in your non-Laravel PHP apps as well. And the good news is it’s rather easier than you might think. Laravel provides a standalone pacakge called Capsule which you can use in your own project. It’s a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It currently supports MySQL, Postgres, SQL Server, and SQLite.
Using Lazy Collections on memory-hungry operations in Laravel 6
September 4, 2019 — Laravel team has recently released v6.0
of the framework and with this they have added a bunch of exciting new features. Among which, I’m going to talk about Lazy Collections in this article. In Laravel, Illuminate\Support\Collection
class provides a fluent, convenient wrapper for working with arrays of data. In face, all the Eloquent queries are always returned as Collection
instances. LazyCollection
essentially extends the features of the Collection
class. Let’s talk about them in detail.
Process model records in chunks in Laravel
August 27, 2019 — In this tweet, Freek Van der Herten explains how to process chunk of records from a model instead of loading all of them at a time which can help using less memory. Learn more about it in the article.
Rate limit route requests in Laravel
August 26, 2019 — As backend developers, to make our web application full proof we need to make sure our application is running as efficiently as possible all the time. Otherwise, everyone using your database will suffer from slow performance. API limiting, which is also known as rate limiting, is an essential component of Internet security, as DoS attacks can tank a server with unlimited API requests.
Understanding Constructor and Method dependency injection in Laravel
August 3, 2019 — To understand, how dependency injection works in Laravel, let’s just get to know what dependency injection actually is, in software engineering.
Serialize Closures in PHP using this neat package
July 22, 2019 — It’s widely known that PHP can’t serialize closures directly. If you try to serialize a closure in PHP, it will result in a fatal error. Take below for example.
Fetch results based on the existence of the relationship in Laravel Eloquoent
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.
Conditional attributes and relationships in Laravel Resources
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.
Re-using query constraints in Laravel Eloquent - Global vs. Local scopes
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.
Logout from every devices except the currently logged in one in Laravel
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.
Laravel Route Model Bindings - Implicit Vs. Explicit Binding
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.
Attribute casting in Laravel Eloquent
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”.
JavaScript functions' implementation inspired by PHP and Laravel
March 29, 2019 — A sometime ago I tried my hands on implementing some of the PHP’s native functions in native JavaScript. The result is quite interesting list of JavaScript functions you’ve never asked about.
Implement Invite-only registrations using Laravel's signed URLs
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.
Fetching dynamic attributes for models on-the-fly in Laravel
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.
Packages to make your Laravel development experience awesome.
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.
Build your own Laravel artisan commands for your project
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.
Why you should use Laravel Queues
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.
Laravel - Accessors & Mutators
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.
Laravel Eager Loading - load() Vs. with()
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: