How to add a package in Laravel?

< 1 min readTo add a package to your Laravel application using Composer, you can use the require command followed by the package name. For example, to add the laravel/ui package to your Laravel application, you would run the following command: This will add the package and any dependencies it has to your Laravel application. You can also…

Read More

What is Eager loading in Laravel?

< 1 min readIn Laravel, “eager loading” refers to the process of loading related models when querying a parent model. This is in contrast to “lazy loading,” which loads the related models only when they are accessed. Eager loading can improve the performance of your application by reducing the number of database queries that are needed to load…

Read More

How to send an email using Sendgrid in Laravel?

< 1 min readTo send email using SendGrid in Laravel, you’ll need to do the following: Install the SendGrid PHP Library: You can install the SendGrid PHP library using Composer by running the following command: Configure your SendGrid API Key: You’ll need to obtain an API key from SendGrid and add it to your Laravel application as an…

Read More

How to create a PHP package for Composer?

2 min readTo create a PHP package that can be installed via Composer, you’ll need to do the following: Set up a repository for your package: This can be on a platform like GitHub, GitLab, or Bitbucket. Create a composer.json file in the root of your package repository: This file should contain metadata about your package, including…

Read More