InfyOm Blog


We often listen to the words "Eager Loading" & "Lazy Loading" in Laravel. but maybe some of how still don't know what that actually stands for.

What Lazy Loading means?

I worked with many projects that is developed by some other developers and the common problems in code I found us Lazy Loading queries everywhere.

To understand it more easily let's take one simple example.

Let's say There is Post model and Comments Model.

So basically post->hasMany('comments')

So let's say we are fetching 10 posts and now we want the comments of each post. what we will do is :

$post->comments()->get() (LAZY LOADING)

Lazy loading cause N+1 queries issues as every time we are fetching comments of each post and it will block the execution too for while as its queries from the DB.

What Eager Loading means?

Eager loading is very useful when we are working with large-scale projects. it saves lot's of execution time and even DB queries too :)

Let's take the above example to understand the Eager loading.

$posts = Post::with('comments')->get()

$post->comments (EAGER LOADING)

here when we retrieve the posts at that time we are fetching its comments too on the same query. so when we do $post->comments it will not again do query into DB or not even block execution as the comments are already there in model instance.

So this is how Eager loading saves your time and also prevents N+1 Query.

Hope that helps.

August 13, 20221 minuteuserVishal Ribdiya


How to write an email to a potential client

Reaching sales prospects over email is an opportunity to sell and develop a working relationship with a new client.

Write a subject line

The first step in writing a strong email to a prospect is to consider the subject line. The first thing a potential client will see in an email is the subject line, so it's important that it persuades the recipient to open the email. Here are some strategies you can use to write a compelling subject line:

Here's what you should do if you want to write good email subject lines:

  • Use personalization.
  • Ask an engaging question.
  • Use concise and action-oriented language.
  • Take advantage of scarcity and exclusivity.

Give information about yourself.

You will more likely gain traction if they already know, like, and trust you. But everyone has to start somewhere, right?

If they've never received a communication from you, tell them a little about yourself in a way that feels warm and authentic. You must convey who you are and why they should listen to you. At the same time, it's essential to make it about them. For example, your email sales introduction could look something like this:

"My name is [name], and I'm contacting you because..."

Close the email with a salutation

You can include a closing salutation that matches the level of formality you used to open the email. Here are a few examples of closing salutations for professional emails:

  • Thank You
  • Best wishes
  • Regards
  • Looking forward to hearing from you
  • Sincerely
August 16, 20221 minuteauthorAnkit Kalathiya
Node.js vs. Deno: Which is better?

Node.js vs. Deno: Which is better?

There is no doubt that Node.Js is the most widely used JavaScript runtime environment, but Deno is more secure and offers more features.

Compare Deno and Node.js to see which is better for your next project, the purpose of this article is to introduce you to Deno and Node.js, their differences, and how to choose the right one for your upcoming project.

What is Node.js?

Created by Ryan Dahl in 2009, Node is a server-side JavaScript environment based on Google’s V8 javascript engine and heavily focused on event-driven HTTP servers. This paradigm of JavaScript everywhere allowed the development of web applications using a single programming language by bringing server-side JavaScript to the mainstream.

At JSConf EU 2018, Ryan Dahl presented “10 Things I Regret About Node.js” - a talk titled “Design Mistakes in Node”. In his talk, he details his regrets regarding some of the choices that were made in the development of Node.

In order to fix many of the design flaws mentioned at the talk, Ryan decided to introduce Deno, which ends support for legacy applications.

What is Deno?

Deno is a secure runtime for JavaScript and TypeScript that has been extended for JavaScript XML (JSX), and its TypeScript extension, TSX. Developed by the creator of Node.js, Deno is an attempt to reimagine Node to leverage advances in JavaScript since 2009, including the TypeScript compiler.

Like Node.js, Deno is essentially a shell around the Google V8 JavaScript engine. Unlike Node, it includes the TypeScript compiler in its executable image. Dahl, who created both runtimes, has said that Node.js suffers from three major issues: a poorly designed module system based on centralized distribution; lots of legacy APIs that must be supported, and a lack of security. These fixes are covered in Deno.

Can we use Node.js and Deno together?

Node.js or Deno are both excellent choices for server-side JavaScript projects. But is it possible to combine them? The answer to that is a definite “maybe.”

The first thing to note is that Node packages from Deno often work just fine. Fortunately, there are workarounds for most of the common stumbling blocks. In addition, Deno standard library modules can be used to “polyfill” the built-in modules of Node; CDNs can be used to access npm packages in Deno-compatible ways, and import maps can be used. Additionally, Deno supports Node compatibility mode since version 1.15.

However, Node’s plugin system does not work with Deno; Deno’s Node compatibility mode does not support TypeScript, and a few Node modules (such as VM) do not work with Deno.

Here is a cheat sheet for Node users interested in switching to Deno.

Which to choose: Node.js or Deno?

Choosing the right technology for your use case depends on a variety of factors. Don’t fix an existing Node.js deployment if it’s not broken. My recommendation would be to strongly consider Deno if you intend to write a new TypeScript project. It’s pretty hard to predict whether you’re going to be successful without a proof-of-concept: Node.js packages are difficult to integrate with Deno without trying them out.

August 13, 20223 minutesauthorSmit Gajera
Implement Bootstrap Laravel Livewire tables

It's 2022 and people are still using the old jquery tables with Laravel. As laravel have the livewire why do we have to use the jquery tables ??

In this tutorial, we are going to use the livewire tables and gonna see the benefits of it.

The main problem I see with Jquery Datatable is :

  • Page will flicker when we do any search, as it will fire the server-side query and fetch results
  • HTML Appending into JS for action column
  • It's not easy to customize the row, we have to write the HTML into JS

The main benefits of using Laravel Livewire tables are:

  • After searching results will be quickly updated on-page, without flickering
  • As the Livewire table is JS less, Of course, you don't have to append HTML into it. you can do it via blade files :)
  • You can easily customize the row and tables view by adding your custom blade views.

How to integrate Bootstrap Livewire tables?

For that we are going to use the following package :

Install Package

composer require rappasoft/laravel-livewire-tables

Publish Assets

php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-config

php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-views

php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-translations `

Choosing Bootstrap 5 theme

Into the published config file you can choose/change theme to bootstrap-5

    return [
        * Options: tailwind | bootstrap-4 | bootstrap-5.
        'theme' => 'bootstrap-5',

Render the components

    <livewire:members-table />

Create Component

    namespace App\Http\Livewire;

    use App\Models\User;
    use Rappasoft\LaravelLivewireTables\DataTableComponent;
    use Rappasoft\LaravelLivewireTables\Views\Column;

    class MembersTable extends DataTableComponent
        protected $model = User::class;

        public function configure(): void

        public function columns(): array
            return [
                Column::make('ID', 'id')

That's It :)

That's it, and you will see the bootstrap-5 Laravel livewire table. it have other lot's of fucntionality too, you can use or disable it as per your need.

July 04, 20222 minutesauthorVishal Ribdiya
Top Laravel packages that you need in 2022

What is Laravel?

Laravel is the most popular PHP framework right now to develop web applications, it offers a very easy environment and services for developers.

In this blog, we are going to know about the packages that we must have to use while developing any laravel application.

Best Laravel Packages

Here we are going to see some best and top laravel packages that will help you to optimize your application performance and it's also very useful while doing the development.

IDE Helper


It's a very helpful package and saves lots of time for the developer.

It will generate the helper file which enables our IDE to provide accurate autocompletion while doing the development.

Laravel Debugbar

Github :

This is very helpful when we have to check the page performance, in sense of how many queries are firing on the specific page? , how many models are loading? etc.

We can show the total processing time of the page, and the query results time too. by using that results we can do some refactor to our code and make our application more optimized.

Spatie Medialibrary

Github :

This package is very useful when we are doing file uploads. also, it allows us to upload files to the s3 (AWS) very easily by changing just the file system driver.

The main functionality it has is it allows us to associate files with the Eloquent models.

Spatie Role Permission

Github :

It's 2022 and still, lots of developers are using the custom roles/permissions management. they even didn't familiar that this package have capabilities to manage each role/permissions management with a specific Eloquent model too.

We can assign roles or permissions to the user model or even any model. later we can check it via the middleware that this package is providing.


Github :

Before using this package you must need to implement the named routes into your laravel application.

Normally people can just provide a hardcoded URL into the JS file while doing the AJAX calls. But with this package, you can use the route we are using in blade files.

This allows us to use the route() helper method in the JS files.

June 09, 20222 minutesauthorVishal Ribdiya
How to Make Sales and Marketing Meetings More Effective and Impactful

When done effectively, regular sales meetings are crucial to your team's success. In addition to sharing important updates and enabling group discussions, they can also help motivate your sales team.

What was supposed to be a way to make your team more successful turns into another series of updates. Before you know it, your sales representatives are starting to get scared by taking time out of their days to attend.

Establish expectations

When it comes to meetings that involve a lot of people, it is good to set some basic rules in advance. If your sales meetings are going overtime, you might want to consider addressing expectations. To save time and make sure you don't get sidetracked, you can:

  • Make sure participants know they should be prepared
  • All participants are required to participate
  • Control the time spent on discussion topics

Set a goal

The tradition of having a sales meeting once a week is not enough reason to hold a meeting. Yes, you want to block time in your calendar so that your sales team can get together, but it's okay to leave it.

At the end of the day, meetings without a specific purpose seem meaningless and just turn into another calendar entry. What’s worse, they can negatively affect your team’s performance for the rest of the day.

Review the results before the sales meeting

Depending on the size of your team, it may take time to review their results. That’s why your best bet is that they deliver the data before the meeting. The most comprehensive way to do this is to have a live document that they can update in advance.

Make your sales meetings exciting

Just because it’s a sales meeting, doesn’t mean it needs all the data and is no fun. Don’t forget that your team will pick up your energy. In other words, if you treat the meeting as a task, your team will not be more excited than you.

Now, that doesn’t mean you should bring out balloons and colorful wigs. It's just as easy to set the right tone from the start - and the best way to do that is to give credit where it's left.

Maintain consistency

Maintain consistency It is helpful to have a meeting at the same time every week so that your sales representatives get into the habit of blocking the same time on a weekly basis.

This will improve attendance, as your team will always know not to book more of that time unless absolutely necessary. If your team only has experienced salespeople, you can scale your sales meeting back and forth to give them more time to close deals.

June 07, 20222 minutesauthorAnkit Kalathiya
ProGuard in Android

We may have used ProGuard in our project when developing Android applications. In this blog, all of the features and how to use ProGuard effectively on Android.

1. What is ProGuard?

ProGuard is a free java tool in Android, which helps us to do the following:

  • Shrink(Minify) the code: Remove unused code in the project.
  • Obfuscate the code: Rename the names of class, fields, etc.
  • Optimize the code: Do things like inlining the functions.

In short, ProGuard has the following impact on our project:

  • It reduces the size of the application.
  • It removes the unused classes and methods that contribute to the 64K method count limit of an Android application.
  • It makes the application difficult to reverse engineer by obfuscating the code.

2. How to use it in our project?

To enable Proguard in your project, in the app's build.gradle add,

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), ''


Here, we have minfyEnabled as true. It activates the proguard which takes from the file,


It is under the release block, which means that it will only be applied to the release of the build we generate.

But it can be too much sometimes when the proguard removes too much code and it might break your code for the flow.

So, configuring the code we have to add some custom rules to make sure we remove the set of code from obfuscating. We can fix this by writing out custom rules in our proguard and it will respect while generating the build.

Now, let us see how we can write customs rules in proguard.

1. Keeping class files

Assume we have a data class that is required by some API but that we obfuscate by generating a build. We have a User data class, for example.

data class User(val id: String = "")

and we want not to obfuscate the class which generating build then to ignore it from obfuscating we use @Keep annotation and update the code like,

data class User(val id: String = "")

This annotation allows the class to be ignored when minified using proguard. The class and its member functions will be preserved even when not in use.


to preserve options of class while generating the build. Using -keep over @Keep we get more control over what to preserve and what not to.

2. Keeping a class's members

If we want to keep only the class members and not the entire class while shrinking, we can use,


in the proguard rule file. This will help us to ignore members of a specific class.

Consider the above User class, and we want to preserve all the public methods inside it. We write the rule like,

-keepclassmembers class com.mindorks.sample.User{
    public *;

3. Keeping names of the class and members

Let's say we want to keep all of the same class names and members if they are used in the code, i.e. if the class is not used, it will be shrunk by proguard but will not be obfuscated because it has already been shrunk and there is no need for obfuscation.


Practical use of it looks like,

-keepnames class com.mindorks.sample.GlideModule

Here, if the GlideModule would keep all of its names of the class and the member function.


As a fragment TAG, do not use something like MainFragment.class.getSimpleName().

While obfuscating, Proguard may assign the same name (A.class) to two different fragments in different packages. Two fragments will have the same TAG in this case. It will result in a bug in your application.

Keep your Proguard mapping file in order to trace back to the original code. You may need to upload it to different locations, such as the PlayStore Console, to see the original stack-trace of the crashes.

June 06, 20223 minutesauthorVivek Beladiya
Top 5 UI/UX Design Tools

UX and UI tools have played a pivotal role in shaping the digital economy since their inception. If a tool, no matter how effective, fails to solve your specific problem, it is not the right tool for you. A tool may be equipped with remarkable functionalities, but it is futile if it is not user-friendly on a day-to-day basis. Moreover, a tool requires being utmost integration-friendly to make the entire design phase transition effortless. Here take a glance at the top 5 UI UX design tools that score well on all these significant aspects.

Adobe XD

Adobe UI UX design tools continue to evolve, and Adobe XD being the latest tool boasts an innovative collaboration feature that empowers you to work collaboratively through seamless document sharing. This flagship UX tool enables you to generate animated micro-interactions with the said elements while allowing you to create elements. However, this solid prototyping tool does not come devoid of cons. It does not allow you and your colleague to work simultaneously on the same document.

Availability: Windows/macOS


As one of the dynamic, collaborative prototyping UI UX design tools, Figma imparts a second to none collaborative environment wherein you and your colleagues can build prototypes, and test them for usability while tracking all the progress live. Empowered with the noteworthy interface, it provides the element insertion, code, and scrolling animations to build high-fidelity prototypes. Being browser-based, it is a great tool that lets teams create, test, and deliver better designs right from start to end.

Availability: Windows/macOS. It also imparts a mobile app aiming to mirror prototypes.


Reckoned as the Godfather of UI UX design tools, Sketch makes it effortless for you to develop engaging mockups. Immaculate and easy-to-use interface, this first 100% UX/UI tool aligns well with the majority of the tools related to prototyping. However, collaboration is one concern as Sketch is compatible only with macOS.

Availability: macOS only

Invision Studio

It is regarded as one of the most dynamic screen UI UX design tools that offer a bundle of 4 tools encompassing Prototyping, Inspection, Freehand tool, and Craft tool while imparting you a hassle-free experience. It aligns well with Sketch. The digital whiteboard feature of this tool empowers team members to translate their ideas effortlessly.

Availability: macOS and Windows


No matter whether you intend to design, collaborate or prototype, leverage the advanced functionalities of Mockplus that swiftly let your ideas turn into functional prototypes with icons, interactions, and components.

Availability: Windows, macOS

June 03, 20222 minutesauthorKishan Savaliya
How to use Multi Tenant with Multi Databases Into Any Laravel Application ?

People are quite afraid :), including me :) when it’s about the developing system that works with multi-tenant / multi-database.

In this tutorial, we will implement a multi-tenant system that will create a separate database when the new tenant will create.

Install Package

composer require stancl/tenancy

Then run the following command :

php artisan tenancy:install

Then add the service provider TenancyServiceProvider to your config/app.php file:

 * Application Service Providers...
// App\Providers\BroadcastServiceProvider::class,
App\Providers\TenancyServiceProvider::class, // <-- here

Setup Tenant Model

namespace App;

use Stancl\Tenancy\Database\Models\Tenant as BaseTenant;
use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\Database\Concerns\HasDatabase;
use Stancl\Tenancy\Database\Concerns\HasDomains;

class Tenant extends BaseTenant implements TenantWithDatabase
    use HasDatabase, HasDomains;

Then, configure the package to use this model in config/tenancy.php:

'tenant_model' => \App\Tenant::class,

Create Migrations For tenant

Create one migration and move that migration file to migrations/tenant. So when we are going to create new tenant this migarations files will run for that new tenant.

You can do the same for seeders. if you want to change the seeder file then you can change it from the config/tenancy.php

Create Actual Tenant

$tenant = Tenant::create([
    'id' => time(),


Now when we run above code it will create new tenant and also create new database with related prefix and given id value.

So it will create following things :

  • New Tenant will be created in main database
  • New tenant database will be created
  • New migrations and seeders will be executed into new tenant database.

Hope that will helps a lot.

June 02, 20221 minuteauthorVishal Ribdiya