Our Latest Blog Posts

latest-post

Stripe Connect is the fastest way to integrate payment into your marketplace.

In this tutorial we are going to integrate the stripe connect with Laravel.

To integrate the stripe connect you must need the stripe secret and the stripe key. You can get that credentials from your Stripe account.

So let's start integrating...

Installation

composer require srmklive/paypal:~2.0

Onboard the seller using Stripe connect

Define the route for onboarding the seller.

  Route::get('onboard-seller', [StripeController::class, 'onboard']);

Now on StripeController.php write the code for the onboarding link.

use Stripe\Stripe;
use Stripe\Account;
use App\Models\User;
use Stripe\AccountLink;

public function onBoard()
{
    $user = Auth::user();

    /** @var User $user */
    if (empty($user->stripe_on_boarding_completed_at)) {
        Stripe::setApiKey(stripeKey());

        if (empty($user->stripe_connect_id)) {
            /** @var Account $account */
            $account = Account::create([
                'type'         => 'express',
                'email'        => $user->email,
                'country'      => 'US',
                'capabilities' => [
                    'card_payments' => ['requested' => true],
                    'transfers'     => ['requested' => true],
                ],
                'settings'     => [
                    'payouts' => [
                        'schedule' => [
                            'interval' => 'manual',
                        ],
                    ],
                ],
            ]);

            $user->stripe_connect_id = $account->id;
            $user->save();
        }

        $user->fresh();

        $onBoardLink = AccountLink::create([
            'account'     => $user->stripe_connect_id,
            'refresh_url' => route('organization.dashboard'),
            'return_url'  => route('stripe.onboard-result', Crypt::encrypt($user->stripe_connect_id)),
            'type'        => 'account_onboarding',
        ]);

        return redirect($onBoardLink->url);
    }


    $loginLink = $this->stripeClient->accounts->createLoginLink($user->stripe_connect_id, []);

    return redirect($loginLink->url);
}

Please note that you have to generate routes for return and cancel URLs.

Once a merchant is successfully onboarded stripe will again redirect him to the return_url

Below you can find the code in which we managed the success callback.

public function onBoardResult($encodedToken)
{
    /** @var User $user */
    $user = User::whereStripeConnectId(Crypt::decrypt($encodedToken))->firstOrFail();

    $user->stripe_on_boarding_completed_at = Carbon::now();
    $user->save();

    return redirect(route('dashboard'));
}
June 02, 20231 minuteuserVishal Ribdiya

Posts

Understanding CSS Attribute Selectors

In HTML and CSS, an attribute selector is used to select any element with a specific attribute or value. This is a great way to style HTML elements by grouping them based on some specific features, and the feature selector will select elements with similar elements.

In CSS LifeStyle Example: We know that styling HTML elements with their tag names, class names, ID names, etc.
This all will apply the changes to all tags or all classes or all ID names within the page. But if I have a situation where I want to apply styles to a tag name but only a few of them we just name their attribute in the indexing bracket. Therefore that it can only apply those changes to matching tag name and attribute name matching elements.

Here are 7 CSS Attribute Selector Syntax:

  • [attribute]
  • [attribute=value]
  • [attribute~=value]
  • [attribute|=value]
  • [attribute^=value]
  • [attribute$=value]
  • [attribute*=value]

1) [attribute] Selector only used to select HTML elements with the required attribute.

// This will color the tag with a title attribute.

a[title] { 

     color: yellow;
}

<a href=”” title=””>

2) [attribute=value] Selector used to select HTML elements with required attribute and value.

// This is used to select HTML elements with the required target and _blank.

a[target=”_blank”] { 

   color: yellow;

}

<a href=”” target=”_blank”>

3) [attribute~=”value”] Selector used to select HTML elements with required attribute value contains a given word anywhere in the selector.

// This will color the tag with title attribute value as a para word.

[title~=para] { 
   color: yellow;

}

<p title=”hello_para”/> 
<p  title=”_blank_para”>

4) [attribute|=”value”] Selector used to select HTML elements whose attribute value starting with specified value.

//This will color the tag with class attribute value as starting with the specified value
.

[class!=mango] { 
color: blue;

}

<p class=”mango_yellow”/> 
<p class=”” title=”mango_red”>

5) [attribute^=”value”] Selector used to select HTML elements whose attribute value begins with the specified value.

// This will color the tag with class attribute value as start with the specified string
.

[class!=”there”] { 
color: blue;

}

<p class=”there_yellow” />
<p class=”” title=”there_red” />

6) [attribute$=”value”] Selector used to select HTML elements whose attribute value ends with the specified value.

//This will color the tag with class attribute value as ends with the hello string
.

[class$=”hello”] { 
color: blue;

}

<p class=”hi_there_hello” /> 
<p class=”I_am_hello” />

7) *[attribute=”value”] Selector** used to select HTML elements whose attribute value contains specified value anywhere in the attribute value.

//This will color the tag with class attribute contains specified value anywhere
.

[class*=”am”] { 
color: blue;

}

<p class=”gaming”/> 
<p class=”games”/>
September 08, 20213 minutesauthorPayal Pansuriya
How to Setup Swagger in Laravel Application

Generally, we are using a Swagger in Laravel. it will take time if we set up swagger manually. so, In this article, I going to show you very easy steps for setup in Laravel.

You can watch the following video tutorial as well.

Steps 1:

You should download these assets from here. unzip the folder and go to the public directory. you can found the swagger directory in the side public folder. let open the swagger directory and you can see the following files.

  • jquery-2.1.4.min.js
  • style.css
  • swagger-bundle.js
  • swagger.yaml

If are you still confuse then visit this link for files.

now, Copy the swagger directory and put it in your laravel application on the same path.

Steps 2:

We need to load swagger with proper swagger UI. so, let navigate to resources/views on the downloaded source code project.

You can see the swagger directory inside the views directory. copy the swagger directory to your laravel application on the same path. I don't think you need to do anything in this view file. let's go to the next step.

Steps 3:

You need to update this swagger.yaml file. you should update the following details first. and then add APIs documentation in this file. Api document example given here. you can refer it.

info:
  description: LPT APis
  version: 1.0.0
  title: LPT Frontend API's
basePath: /api/

Steps 4:

In this step, you need to create a route for loading swagger docs. so, let's open the web.php file add the following few lines of code.

Route::get('/docs', function () {
    return view('swagger.index');
});

Now, run a command php artisan serve and open http://127.0.0.1:8000/docs or open a virtualHostDomain/docs if you have one.

You should watch this tutorial as well if you using InfyOm Generator

September 06, 20213 minutesauthorShailesh Ladumor
How to connect strapi CMS in gatsby website

Gatsby

Gatsby is a blazing-fast website framework for React. It allows developers to build React-based websites within minutes.

Strapi CMS

Strapi is an open-source, Node.js based, Headless CMS that saves developers a lot of development time while giving them the freedom to use their favorite tools and frameworks.

Integrate Gatsby with Strapi

Install gatsby-source-strapi package

npm i gatsby-source-strapi

gatsby-config.js file

  • add the gatsby config file in the following code

plugins: [
    {
        resolve: `gatsby-source-strapi`,
        options: {
            apiURL: "your strapi server",
            contentTypes: ["restaurant"], //add your collections name
            queryLimit: 1000,
        }
    }
]

Now connect your gatsby website and strapi CMS

  • Here is an example of the GraphQL API query
import { StaticQuery, graphql } from 'gatsby';

const query = graphql`
  query {
    allStrapiRestaurant {
      edges {
        node {
          strapiId
          name
          description
        }
      }
    }
  }
`

const IndexPage = () => (
  <StaticQuery
    query={query}
    render={data => (
      <ul>
        {data.allStrapiRestaurant.edges.map(restaurant => (
          <li key={restaurant.node.strapiId}>{restaurant.node.name}</li>
        ))}
      </ul>
    )}
  />
);

export default IndexPage;

Hope this helps.

September 01, 20212 minutesauthorVatsal Sakariya
How to Increase Product Sales on the Website

An easy way I'm going to show you how to increase product sales on the website. Also, you can apply this method and increase your products sales without any problems.

5 Ways to Increase your products sales on the website. Read whole blog content so, you can idea how to increase product sales in a short time.

Let's get started with this reliable technique to increase product sales on the website.

1. First, Know your Buyer's Persona

To reach your ideal customer first know who they are and should they are related to your product or not

Who are your buyers?

first, know who is your customer is and should they are matched with your custom criteria so, you can easily convince them to buy your products.

How to Convince them?

If your customer is relevant to your product niche so, you can easily convince them to buy your products and you can increase product sales.

2. Create Attractive Landing Page

The second step is to create an attractive landing page to attract customers to your website.

Create a simple landing page and describe more about your products so customers know what are the features of your product and how to use them.

Attract more customers to your landing page by adding video and Increase your sales on the website.

3. Add Testimonials & Case Studies of Product

The best way to convince your customer about your product is to add testimonials & case studies. Customers easily attract to this technique and trust your products.

Testimonial is a showing off your products rating and customer review. Good ratings and reviews easily built trust. Using this technique you can increase product sales.

4. Create Urgency

Everyone knows about Amazon. Amazon also creates an urgency to attract customers and sell more products. Urgency like, Hurry Up, Buy now, Sell end in 2 days, 24 hours left it's all are types of urgency.

So people can think about a product that sales are ends in 2days and they can buy before the end of the sale.

5. Give Offer - Money Back Guarantee

One of the most powerful reasons is customers not buying products is the risk factor of money back.

You can give an offer like this If you are not satisfied with our products then we will return your money 100%. If customers see this type of offer so they can think about buying your products. This is an easy way to increase product sales using this technique

Conclusion:

Using this technique you can easily increase your product sales on the website. All techniques are important and reliable.

August 31, 20212 minutesauthorAnkit Kalathiya
How to Change  App Language in Android Programmatically?

Android 7.0 (API Level 24) provides support for multilingual users, allowing users to select multiple locales in the setting. The locale object budget represents a specific geographic, political, or cultural area.

Operations that require this locale to perform a task are called locale-sensitive and use that locale to generate information for the user.

Step 1: Create A New Project & Create Resource Files

To create a new project in Android Studio.

In this step, we need to create a string resource file for the Gujarati language.Go to app > res > values > right-click > New > Value Resource File and name it as strings.

Now, we have to select the qualifier as a locale from the available list and select the language as Gujarati from the drop-down list. Below is a picture of the steps.

resource

language

Now, in this resource file, strings.xml(gu-rlN) add the code given below.

<resources>
    <string name="app_name">Change App Language</string>
    <string name="selected_language">ગુજરાતી</string>
    <string name="language">કેમ છો</string>
</resources>

And add this line to the string.xml file, which is the default for English.

<resources>
    <string name="app_name">Change App Language</string>
    <string name="selected_language">English</string>
    <string name="language">How are you</string>
</resources>

Step 2: Create The Layout File For The Application

In this step, we will create a layout for our application. Go to applications> res> Layout> activity_main.xml and add two text views, one for the message and one for the selected language, and an image view for the drop_down icon. Below is the code snippet for the activity_main.xml file.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/textView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="48dp"
        android:text="Welcome To InfyOm"
        android:textAlignment="center" />

    <Button
        android:id="@+id/btnGujarati"
        android:layout_margin="16dp"
        android:background="@color/colorPrimary"
        android:textColor="#ffffff"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Gujarati"/>

    <Button
        android:id="@+id/btnEnglish"
        android:layout_margin="16dp"
        android:background="@color/colorPrimary"
        android:textColor="#ffffff"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="English"/>

</LinearLayout>

Step 3: Create LocaleHelper Class

Now, we will create a local helper class. This class has all the functions that will help to change the language at runtime. Go to app > java > package > right-click and create a new Java class and name it LocalHelper. Below is the code for the local helper class.

import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.preference.PreferenceManager;

import java.util.Locale;

public class LocaleHelper {
        private static final String SELECTED_LANGUAGE = "Locale.Helper.Selected.Language";

        // the method is used to set the language at runtime
        public static Context setLocale(Context context, String language) {
            persist(context, language);

            // updating the language for devices above android nougat
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                return updateResources(context, language);
            }
            // for devices having lower version of android os
            return updateResourcesLegacy(context, language);
        }

        private static void persist(Context context, String language) {
            SharedPreferences preferences =                       PreferenceManager.getDefaultSharedPreferences(context);
            SharedPreferences.Editor editor = preferences.edit();
            editor.putString(SELECTED_LANGUAGE, language);
            editor.apply();
        }

        // the method is used update the language of application by creating
        // object of inbuilt Locale class and passing language argument to it
        @TargetApi(Build.VERSION_CODES.N)
        private static Context updateResources(Context context, String language) {
            Locale locale = new Locale(language);
            Locale.setDefault(locale);

            Configuration configuration = context.getResources().getConfiguration();
            configuration.setLocale(locale);
            configuration.setLayoutDirection(locale);

            return context.createConfigurationContext(configuration);
        }

        @SuppressWarnings("deprecation")
        private static Context updateResourcesLegacy(Context context, String language) {
            Locale locale = new Locale(language);
            Locale.setDefault(locale);

            Resources resources = context.getResources();

            Configuration configuration = resources.getConfiguration();
            configuration.locale = locale;
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
                configuration.setLayoutDirection(locale);
            }

            resources.updateConfiguration(configuration, resources.getDisplayMetrics());

            return context;
        }
    }

Step 4: Working With the MainActivity.java File

In this step, we will apply Java code to switch between string.xml files to use different languages. First, we will initialize all the views and set click behavior on an Alert dialog box to choose the desired language with the help of the LocalHelper class. Below is the code is given for the MainActivity.java class.

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    TextView messageView;
    Button btnGujarati, btnEnglish;
    Context context;
    Resources resources;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        messageView = (TextView) findViewById(R.id.textView);
        btnGujarati = findViewById(R.id.btnGujarati);
        btnEnglish = findViewById(R.id.btnEnglish);

        btnEnglish.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                context = LocaleHelper.setLocale(MainActivity.this, "en");
                resources = context.getResources();
                messageView.setText(resources.getString(R.string.language));
            }
        });

        btnGujarati.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                context = LocaleHelper.setLocale(MainActivity.this, "hi");
                resources = context.getResources();
                messageView.setText(resources.getString(R.string.language));
            }
        });

    }
}
August 26, 20213 minutesauthorVivek Beladiya
Steps of UI/UX Design Process

The entire UI / UX design process can be divided into 5 stages. The responsible department of your organization will analyze every step, and so it will be almost complete!

Design_Process

The various steps involved in the User experience design process are as follows:

1.Product Definition

  • Product definition is the first step involved in the user design process. The team responsible for this will collect the user's needs based on their business environment.

  • It is very necessary because the real scope of the product and the understanding of their existence takes place at this stage.

  • It's simple; Before starting work, explain the requirements to your UI / UX designers!
  • The people involved in this phase are the design team, the business manager, and the product manager. The entire team should consult with clients in their environment. Analyze their needs within the framework of your operation.

  • Notable results of this phase are user personality, user stories, and use case diagrams.

Product_Definition

2. Research

Research is the most crucial element for a designer. The designing team studies how the existing system works for the current client proposal. There are three main functions at this stage:

  • Have an understanding of competition.
  • Study your existing domain thoroughly.
  • Going through a competitive strategy to test the results.

The research process should also include an understanding of the latest UI / UX trends, design principles, and guidelines.

3. Analysis

In this phase, use the items collected in the research phase. Using the information obtained, create a guessing personality and experience the map.

  • Hypothetical Personas: Creating predictable scenarios helps designers learn about different individuals who will be users of your product. It allows showing the actual presentation of the final product. The design team can figure out what the look will look like after delivery.

  • Experience Maps: Experience maps show user flow in your final product. All this is done using visual representations through proper interaction with the client in the product definition phase.

4. Design

In the design process, we finally finish giving life to the ideas collected in the above three steps. Now is the time to work on the final graphics. The design team will execute the final design at this stage.

Significant results of the designing phase are:

Sketching:

The designing phase begins with sketching. Designers usually create handmade sketches to visualize the concept in simple terms. UX / UI designers can stick to a specific option after the sketching process.

Design

Creating wireframes:

A wireframe is a visual structure that displays page hierarchy and elements in a product. The wireframe is considered the backbone of the product. It is also called the skeleton of design. It’s mostly about the overall look of the final product.

Creating Prototypes:

The prototypes focus on the realization of the UI / UX product that one designs. It’s more about the experience of interaction. Prototypes give you the effect of a simulator.

Creating Design Specifications: Design specification includes user flow and task flow diagrams. It depicts the overall working and the style requirements of the UI/UX product. It describes the processes and graphical elements to create amazing user experiences.

5.Validation or Testing

Validation_or_Testing

Testing is a phase that determines the overall quality of the final product. Examiners make notes of matters that need to be corrected and send them back to a respected team to correct errors.

When evaluating your final product, there are several factors to consider. They are as follows:

  • Is the system user-friendly?
  • Is it flexible and easy to operate?
  • Does it solve the client's problem?
  • Is it reliable and attracts users to come back every time they need your service?

To create an amazing UX / UI interface, one needs to follow a systematic and organized approach. A UI / UX design process strategy will help you achieve that.

The entire design team will play its part in the process. This is a great way to retain your existing customers and attract new ones in this highly competitive world.

August 21, 20213 minutesauthorKishan Savaliya
What Are The Different Types of SEO Techniques?

Today I'm going to show you Types of SEO. Basically, White Hat SEO, Black Hat SEO, Gray Hat SEO are the types of SEO and all are different from each other.

All SEO people or people who want to try to rank a website on google must understand the terms Types of SEO.

So, Let's get started with this topic what are the types of SEO.

1. Types of SEO - White Hat SEO

If you want to Rank organically Website in google as long so, recommended technique is White Hat SEO.

Benefits Of White Hat SEO

  • Organic and Ethical SEO Activities are used in white hat SEO.
  • A white hat SEO technique is a must for the best long-lasting and sustainable rankings and results.
  • For building a positive online reputation this technique is must require.

Techniques of White Hat SEO

  1. Making SEO websites that is user-friendly according to the Google updates and guidelines.
  2. Website loading speed technique and responsive website are must user friendly.
  3. Quality evergreen informative content gives the best results.
  4. Meta tags and descriptions should be keyword-rich and relevant to page content and URL.
  5. Keep site structure user friendly.
  6. Images and videos must be relevant to the page content.

Apply only the white hat SEO technique if you don't want your site panalized.

2. Types of SEO - Black Hat SEO

Black Hat SEO is the Worst among all types of SEO because you apply this technique/type so, google can deindex your site

Don't recommend or try this type of techniques.

Disadvantages of Black Hat SEO

  • This is a completely unethical process.
  • Violation of SEO guidelines and algorithms.
  • Black hat SEO can provide quick and good results in short term but is not sustainable and long-lasting.
  • Use of black hat SEO can do your domain black list and remove your website from search engines.
  • Black hat tactics are spamming tactics.
  • The website would be deindexed for a lifetime by google.

Techniques of Black Hat SEO

  1. Use of paid links
  2. Hidden text in the website
  3. Article spinning
  4. Hidden links
  5. Cloaking
  6. Website over optimzation
  7. Content scams
  8. Link manipulation
  9. SERP spam
  10. Crooked website

3. Types of SEO - Gray Hat SEO

Gray hat SEO is not white hat SEO or Black hat SEO but it is a combination of white hat SEO & black hat SEO.

In gray hat SEO white hat SEO technique used around 80% to 90% and the Black hat SEO technique used 10% to 20%.

Most people used this technique because in this technique most used white hat SEO.

Sometimes Google can capture black hat SEO techniques in Gray hat SEO that so would be deindexed your site permanently by google.

Conclusion:

In this topic What are the different types of SEO Techniques. White hat SEO techniques are the best for your site which I can recommend and all SEO people also used this technique. So it would be best for all.

August 18, 20212 minutesauthorMilan Gangani
How to Implement Browser Push Notification in Laravel
p>In this article, I show you an easy way to set up browser push notifications. fist of all, you have a question what is push notification? let me explain a bit more. Push notification is the fastest way to get up and running with Javascript desktop notifications. Push notifications are messages that can be sent directly to a user's Desktop via browser.

You can watch the following tutorial and you can continue reading this article.

Follow the Steps given here for setup push notification.

Step 1: You can quickly install Push via npm

npm install push.js --save

Step 2: Update webpack.mix.js

Add following code into webpack.mix.js for copy and publish assets like js in the public directory. you can see the example here

mix.copy('node_modules/push.js/bin/push.min.js',
    'public/assets/js/push.min.js');

I hope you know how to use laravel mix. you can watch this video tutorial if you want to know more about the laravel mix.

fire, npm run dev command and publish js.

Step 3: Add assets in blade file

Add script before closing body tag.

<script src="{{ asset('assets/js/push.min.js') }}"></script>

Step 4: Add this code where you want to show a push

// add logo in public dir and use it here
const iconPath = '{{ asset('logo.PNG') }}
 Push.create("Hello Shailesh!",{
       body: "Welcome to the Dashboard.",
       timeout: 5000,
       icon: iconPath
});
December 03, 20213 minutesauthorShailesh Ladumor