InfyOm Blog

latest-post

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

Posts

How to Generate Organic Leads from Your Website

What are Organic Leads?

Organic leads are your potential customers and customers who search for your company by searching for a specific product, service, or query in a search engine like Google.

In this article, we are going to discuss effective strategies for generating leads organically.

Optimize your website for search engines

Search engine optimization is a tried and tested method of generating organic leads. It may take a while for your website to get on the top pages of Google, but once it gets there, most of your problems will be solved. You can either DIY your search engine optimization campaign, or you can hire a professional to do it for you.

Optimize your website for your target audience

The main rule of generating leads for any business is to give visitors what they want. Of course, this is your website, and you want to design it the way you want it.

But you should not forget that it is the interest of the target audience that will help you get it and drive it.

Enter keywords and phrases in the website content

The best way to insert keywords into your website content is to do it naturally. Your site may be penalized if you try to insert too many keywords into your website content.

Research and survey your products/services. Try to figure out which content works best for them.

Start an active email marketing campaign

Grow your email list and give your email subscribers some extra benefits to stay loyal to your brand. Email marketing will help you learn more about your potential customers on an individual level. It boosts the confidence factor and helps you get more potential organically.

Occasionally share advice, brand videos, and newsletters, and interact with your followers. Ask them for their opinion on your new products/services and give them access to services they would not otherwise have. There are numerous ways to increase your email subscriber list.

Add forms to the pages that get the most traffic.

It is important to benchmark your current position in lead generation before you begin so that you can track your success and determine the areas where you need the most improvement. Some of your pages can create excellent lead generators and you may not even realize it.

June 02, 20222 minutesauthorAnkit Kalathiya
Key Points of Good Test Cases

Testers infrequently suppose about the difference between average and high quality tests. However, also it's frequently inconspicuous, If the test case is good. It indeed simply dissolves in the process of software verification. Testers flash back it only when they find a bug in a system. The following is an analysis showing that your test is of high quality and dependable.Tests Are Suitable for robotisation Occasionally, you can see tests that aren't completely automated. The most popular reason is that commodity is veritably complicated or nearly insolvable.

Test is performed regularly

The test doesn't crash unless the software has changed. Such a rule applies to the basics of original data generation. For illustration, we test the enrolment process for a new stoner. No doubt, if the system doesn’t induce the original dispatch, such a test most probably won’t serve on product.

Test ends with confirmation

It’s true, except in situations where one should clear the information and perform some other processes. Completion by confirmation is the stylish for any test case performing. similar allows you to make sure that the performed action actually passed rightly.

Test is stable and can be habituated in CI/ CD

still, they aren't stable enough to be used with CI/ CD, If your test suites regularly fail. Because every other product company is trying to reach CI and CD, occasionally similar tests aren't only ineffective but indeed dangerous. That’s because they take a lot of time and aren't suitable for automatic use in CI anyway.

Test requires minimum support

Tests aren't created independently. Most frequently, it's the work of a group of people who also have to support them in the future. Any member of the design should understand the test structure snappily and fluently enough. They don’t have to put in too important time and trouble. Indeed if tests are created by one person, occasionally, it can be extremely delicate to understand what this test is responsible for if it isn't created specifically to make tests easier to understand.

Tests Function in resemblant and nothing crashes sooner or latterly, test runs will take a veritably long time. In turn, this leads to slow programming speed and causes the so called “untested patch” effect.

It's worth allowing about resemblant testing so that the checking process would run smoothly. However, it automatically makes resemblant prosecution an easy task of structure debugging rather than a thing of rewriting test cases by all actors of the cargo testing company, If the tests are actuated in resemblant and they do n’t connect.

June 04, 20222 minutesauthorNayan Patel
Sanity Testing: What is it and how is it used?

The Basic Concept of Sanity Testing

When time is brief, Sanity testing are often a far better option than not testing in the least. it's performed to check the modules so their impact are often determined, but without going in-depth. it's useful when deadlines are strict and there's not enough time available to thoroughly test the appliance.

In an Agile environment, big releases are planned systematically and delivered to the client, whereas sometimes, because the situation demands, small releases got to be delivered where there's no overtime available for the testing, leaving no time for documentation of the test cases, bug reporting or Regression Testing.

Items to think about in Sanity Testing

Sanity Testing is performed when time is just too short to check the build thoroughly, and it’s impossible to execute all the test cases. this example risky, and therefore the possible implications are tremendous. To minimise mistakes and oversights, a tester should lookout of a couple of things at their end.

It is advisable to not accept the build where there are not any written requirements available. Sometimes the client conveys changes and/or requirements verbally and expects us to regulate accordingly. Compel the client to supply some written points on acceptance criteria.

Sanity testing is completed when there's not enough time to check the appliance thoroughly, leaving you unable to document bugs and test cases. this is often a but ideal situation so make certain to form your own notes. Document your bugs roughly on your notepad and if there's a while left, share those together with your team for future reference. Throw the ball into the courts of others. Email the list of issues to each stakeholder.

Automation testing can help reduce the pressure of manual efforts.Finally, draft an email containing the most details that you simply have tested, also as what you probably did not test. Give justification and reasons for the bugs that are resolved and people which haven't been.

Advantages of Sanity Testing

Sanity testing focuses on a couple of major areas of functionality which may help in identifying core functionality issues, ultimately saving time Sanity testing is typically non-documented During sanity testing, we are ready to identify missing and dependent functionalities.

Disadvantages of Sanity Testing

The primary focus of the sanity test is to see that the functions of the appliance work needless to say During times when deadlines are tight, organizations like better to perform sanity testing (bypassing regression testing) which leaves a number of the functionalities unattended. this will mean issues continue the assembly environment leaving a nasty impact on the companies. As said, it's non-documented so no official reference is out there.

Conclusion

In the end, the sort of testing you select that situation depends on the intuition of testers. Devise a technique to realize your end-goal. Define how you'll proceed and what you aim to realize with the short time span.

May 03, 20222 minutesauthorNayan Patel
Understand FontIcon Style

Linear

It is the most common style of icon in projects. With its simplicity, it is perfect for a minimalist and modern style.

Linear Icon

Bold

These icons have a fill. We often use them to emphasize the effect of an active option in the navigation of desktop or mobile applications.

Bold Icon

Two colors / Duocolor

As the name suggests, it is a two-color style. this, we can distinguish their more important fragments.

Duocolor Icon

Bulk

It is a combination of the two colors and bold styles. this, the icons are better visible through filling, and at some time, we can emphasize their more important parts.

Bulk Icon

Broken

This style is characterized 'zed by a partial indentation in a given fragment of the icon. This effect distinguishes the icons from the rest and gives them a bit of spice.

Broken Icon

April 24, 20221 minuteauthorPayal Pansuriya
How to Increase Customer Retention Rates

Customer retention is the process of attracting repeat customers and preventing them from moving toward competitors. It is an important aspect of business strategy, and it can help businesses gain a competitive advantage.

The following ways to increase customer retention apply to virtually any type of business

Deliver more than you promised

The next step in the process is to deliver more than you promised - which means going beyond and beyond the call of duty and delivering to your customers the things they didn't expect. For example, you could offer a free bonus (such as a product, discount, or value-added) out of the blue, or anticipate a new customer's need and actively address it.

Meet your customers wherever they are

When you really understand your customers - that is, you know who they are, what they want from you, what their challenges are, and where they spend their time - you will reach them wherever they are. You can create the type of content they want and want (eg blog, video, social media) and then share it wherever they are (eg various websites, media channels, social platforms, etc.).

Good values ​​build good relationships

Your company values ​​are important to you. It should reflect your business processes, the quality of your products, and how you treat your customers. These things should make your values ​​clear to your customers, but reminding them occasionally doesn't hurt.

Trust is the good relationship

Creating a brand that is easily relevant is the first step in building trust with your customers. Having something in common parental trust is the key to building a successful business, through a strong relationship and expansion.

Accept feedback

You never know what your customers really want until you ask. Take regular surveys and request feedback from all your customers. You never know what is missing in you - and what areas need improvement.

Follow up with your existing customers

High touch is the key to retaining the customer. The only unusual thing about personal follow-up is how little companies do it. Getting referrals from happy customers is easier than finding and converting a new business.

April 20, 20222 minutesauthorAnkit Kalathiya
How to integrate Authorize Net into Laravel ?

In this tutorial, we are going to see how we can implement the authorized hosted payment gateway by using their UI and components and take payments from users via authorized net using Laravel.

Create HTML form as like below code :

authorize.blade.php

{{ Form::open(array('url' => 'https://test.authorize.net/payment/payment')) }}

Form::hidden('token', '{{$token}}');

Form::submit('Click Me!');

{{ Form::close() }}

You must have to pass $token to form, we will see below how we can generate that token.

AuthorizeController.php

 public function onboard() {

    $token = $this->getAnAcceptPaymentPage();

    return view('authorize', compact('token'));
 }

 public function getAnAcceptPaymentPage()
 {
    $merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
    $merchantAuthentication->setName(config('payments.authorize.login_id'));
    $merchantAuthentication->setTransactionKey(config('payments.authorize.transaction_key'));

    $refId = 'ref' . time();

    $transactionRequestType = new AnetAPI\TransactionRequestType();
    $transactionRequestType->setTransactionType("authCaptureTransaction");
    $transactionRequestType->setAmount("2050"); 

    $setting1 = new AnetAPI\SettingType();
    $setting1->setSettingName("hostedPaymentButtonOptions");
    $setting1->setSettingValue("{\"text\": \"Pay\"}");

    $setting2 = new AnetAPI\SettingType();
    $setting2->setSettingName("hostedPaymentOrderOptions");
    $setting2->setSettingValue("{\"show\": false}");

    $setting3 = new AnetAPI\SettingType();
    $setting3->setSettingName("hostedPaymentReturnOptions");
    $setting3->setSettingValue(
        "{\"url\": \"http://127.0.0.1:8000/authorize-success?refID\".$refID, \"cancelUrl\": \"http://127.0.0.1:8000/authorize-cancel\", \"showReceipt\": true}"
    );

    // Build transaction request
    $request = new AnetAPI\GetHostedPaymentPageRequest();
    $request->setMerchantAuthentication($merchantAuthentication);
    $request->setRefId($refId);
    $request->setTransactionRequest($transactionRequestType);

    $request->addToHostedPaymentSettings($setting1);
    $request->addToHostedPaymentSettings($setting2);
    $request->addToHostedPaymentSettings($setting3);

    $controller = new AnetController\GetHostedPaymentPageController($request);
    $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);

    if (($response != null) && ($response->getMessages()->getResultCode() == "Ok")) {

    } else {
        echo "ERROR :  Failed to get hosted payment page token\n";
        $errorMessages = $response->getMessages()->getMessage();
        echo "RESPONSE : " . $errorMessages[0]->getCode() . "  " .$errorMessages[0]->getText() . "\n";
    }
    return $response->getToken();

}

Now create routes into web.php as specified below.

web.php

Route::get('authorize-onboard', [\App\Http\Controllers\AuthorizePaymentController::class, 'onboard'])->name('authorize.init');

Route::get('authorize-success', [\App\Http\Controllers\AuthorizePaymentController::class, 'success']);

How it's going to work ?? (flow)

So initially we will call the route that contains that authorization form and also contains the payment information.

Here we are generating token before, generally, it should be generated from the payment screen.

The token will contains the payment information so while generating it make sure you are passing all the details properly.

Now when you submit the form it will redirect you to the authorized checkout page from where users can do payments and again redirect to the success screen.

Once Payment is done successfully you will be redirected to the success route URL with the RefID which is basically the transaction ID, and you can perform related actions on success action.

Hope it will help.

April 16, 20222 minutesauthorVishal Ribdiya
Why to use Figma over other UI Design Tools?

The field of design is rich in tools and software that make the process of designing simple and rapid. Many firms have developed tools for designers to make the wireframing and prototype process more fluid. However, one piece of software has had the most influence on the market: Figma.

Figma is a design and user interface tool that runs on the cloud. The UX/UI design industry was able to enhance workflow and get creative because of its live collaboration, cloud-based design, and easy tools. Let's look at why you should know about Figma and what Figma can accomplish that other design tools can't in order to grasp how and why this tool took the design industry by storm.

Real-time collaboration

Real-time collaboration is available in Figma, which implies that everything the designer generates is done in real-time. It may be viewed by anybody with the link and permission. On the same canvas, developers may code as designers work on the next page. They may also leave each other remarks. Figma also enables unlimited people in a single file, in addition to Live Collaboration with no latency or crashes. This eliminates the need for huge teams to tag in and out members.

real-time-collaboration

Browser-Based

Figma is a browser-based design tool, so all you need is an internet connection and a good browser to get started. You can work even if your internet is down, and it will autosave when the connection is restored. You're no longer restricted to a single device or platform when you use a cloud-based app. Other popular tools confine you to a single device, generating issues for people who operate across many devices.

browser-based

Advanced Prototyping

Figma is a fantastic tool for prototyping user interface and user experience ideas. With powerful yet simple-to-use capabilities, it allows you to develop interactive flows right in the design file. Overlays, move-in, and move-out animations, smart animate property, interactions with a long press, hover, after delay, clicks, and most recently, scrolling animation are just a few of the features available. You may convert your static designs into a realistic rendition of your website or product in only a few minutes.

advanced-prototyping

Easy Handoff

Figma features a built-in inspection tool. As a result, there is no need to employ another tool for handoff. Apart from CSS codes, Figma's handoff also includes iOS and Android codes. You and your colleagues may see and copy the existing code and data for your designs using the Inspect tab. To make the development process easier, copy single line items or complete sets of values.

easy-handoff

Crash-free Zone

Figma saves your work by adding checkpoints to the version history of the file. After 30 minutes of inactivity in the file, as well as if you lose your internet connection or Figma fails, it creates a new checkpoint. This implies that your work will be saved even if you shut the tab. When working on a volatile device, the autosave/auto-backup feature will come in handy, and it also includes version control. You'll be able to restore lost projects thanks to Figma's built-in automated backup mechanism.

crash-free-zone

Figma Community

Figma is home to a fantastic community of designers and engineers. They make plugins for designers and make their work available for anyone to utilize. Thousands of custom-made files and Figma plugins created by Figma users for Figma users may be found in the community. This means you won't have to start from zero on each project; there will be no learning curve and no time wasted figuring out how to automate things. You may grab and go from the Figma Community.

figma-community

Thank you for taking the time to read, I hope I was able to provide you with useful knowledge. Our articles are written with utmost dedication and are based on the Designers Learning Experience Team's research.

April 01, 20224 minutesauthorKishan Savaliya
Why Should Use CSS Variables?

A variable gives us the ability to store a value inside it and then reuse it throughout the code. CSS variables make our work easier and more manageable.

Imagine you have a large project and you have to make changes to the fonts and colors. Now, one common way to do that is by changing them all manually and individually. But this is a nightmare and there are chances that you might miss something.

But with the use of CSS variables, you can do it with a few keystrokes. You just have to change the value of the variable where you have defined it and that's it. So you see that this is where CSS variables come in handy. And CSS variables can be accessed and modified in JavaScript.

Syntax of CSS variables

.root { 
     --primary-color: #151515;
}
  • A CSS variable is defined by adding double hyphens before your property name that follows the property name.
  • The property name could be anything. You can name it whatever you want, but try giving them a reasonable name.
  • After that, you give value to that. CSS variables are case sensitive so be careful while declaring and using one.

To use a CSS variable we use a function called var(). This function recalls the value of the variable and returns it.

Use of the variable:

.title {
     color: var(--primary-color);
}

The above code will set the value of .title class selector's color to #151515.

Scopes of CSS variables :

CSS variables have two scopes

  • Global
  • Local

Global scope :

A variable is said to be in global scope if it is defined in the highest level possible. For that, we use the : root selector for declaring the variables.

:root {
    --text-font-family: sans-serif; 
}

A global scope variable can be accessed anywhere in the code. And you can also modify it.

Local scope :

We can restrict the use of CSS variables to a specific element by declaring in a low-level selector.For example, using it for a specific class.

.container {
     --main-color:#151515;
} 

.container .heading { 
     color: var(--main-color);
} 

Now this variable can only be used by .container selector or its child elements, And all the elements inside .container will initially inherit this property, but elements outside of .container cannot use it.

Overriding CSS variables :

CSS variables can be overridden. If in any part of your code you want to change the value of the variable you can do that.

This is possible by accessing the variable in the local scope and giving it another value.

:root {
     --text-color red; 
}

header {
    --text-color: green; 
    color: var(--text-color); /*color: green*/
}

footer {
    --text-color: blue; 
    color: var(--text-color); /*color: blue; */
}

Now, overriding only works for the element that it is overridden in.

And all the elements inside header and footer tags will get the new property value.

March 30, 20222 minutesauthorPayal Pansuriya