Our Latest Blog Posts

latest-post

In our previous blog, we had seen how to integrate stripe connect. Now we are going to see how we can split payments to the application and vendor using stripe checkout.

Let's take a simple example :

The platform is "Shopify", Merchant (Who is selling products on Shopify) & Customer who is going to register with Shopify.

Now When a customer purchases a product with $1000, Now $10 will be considered as an application fee, which is going to transfer to the Platform Account and the rest amount $90 will be transferred to Merchant.

Create Session using Stripe Checkout

public function generationSession($data)
{
    $session = \Stripe\Checkout\Session::create([
        'payment_method_types' => ['card'],
        'customer_email'       => $data['email'],
        'line_items'           => [
            [
                'name'     => "item name here",
                'amount'   => floatval($data['amount']) * 100,
                'currency' => 'usd',
                'quantity' => '1',
            ],
        ],
        'client_reference_id'  => $data['reference_id'],
        'success_url'          => url('payment-success').'?session_id={CHECKOUT_SESSION_ID}',
        'cancel_url'           => url('failed-payment?error=payment_cancelled'),
        'payment_intent_data'  => [
            'application_fee_amount' => $data['application_fees'] * 100,
            'transfer_data'          => [
                'destination' => $data['user']->stripe_connect_id,
            ],
        ],
    ]);

    return $session;
}

It will return the session object return, later you can use the session id to redirect to stripe checkout.

Redirect to checkout using StripeJS

        fetch('/generate-sesssion', {
            method: 'POST',
        })
        .then(function(session) {
            return stripe.redirectToCheckout({ sessionId: session.id });
        });

Check the transaction from your Stripe Dashboard

Once you do the transaction successfully, you can verify whether the application fee is applied or not from your stripe dashboard.

Hope this tutorial helps you.

July 13, 20231 minuteuserVishal Ribdiya

Posts

What is a clip-path? And how to use CSS clip-path elements?

In this blog, we will learn how to use clip-path and also cover inset(), polygon(), circle(), and ellipse() method .

What is CSS Clip-path?

Clip-path is a CSS property that creates a clipping field that sets which part of a component should be shown and which other parts are hidden. The inside of the clipped area is shown, while the outside is hidden.

CSS Property clip-path creates shapes by clipping an element. It clips some regions of an element to create new shapes. The most used method for clip-path is polygon(), circle(), and ellipse().

CSS clip-path() accepted values

These shapes can be created using basic shape functions. The basic shape functions are listed below:-

  • inset()
  • polygon()
  • circle()
  • ellipse()

inset()

The inset () function allows you to clip a component from around the coordinate system. The result is a visible rectangle. you can assign values to the margin or padding and border-radius property. but two values are limited in rounded corners. The first value is assigned to the top left corner and the bottom right corner and the second value is assigned to the top right corner and the bottom left corner.

inset

polygon()

To design or clip the rectangular parts of the viewport, we use the polygon () method. Polygon is the most commonly used method in clip-path. We can construct any shape using the polygon method.

polygon-example

Example

polygon

circle()

The below image is created by using the clip-path method circle(50% at 50% 50%). In the circle(val1 at var2 var3), val1 is the size of the radius of the circle, and val2 and val3 are the positions of the center. val2 represents the position of the center from the left of the viewport, val2 represents the position of the center from the top of the viewport.

cricle

ellipse()

Below image is created using clip-path method ellipse(25% 40% at 50% 50%). An ellipse(val1 val2 at val3 val4) val1 and val2 are the horizontal and vertical distance from the center. val3 and val4 is the position of center.

ellipse

Resources

I recommend you visit this link to play with the clip-path CSS property. You will see different types of shapes from this link. It's an imaginative place. You can customize your shape.

July 31, 20212 minutesauthorPayal Pansuriya
How to increase sales using Email Marketing?

Email marketing is an effective way to increase your sales. Email marketing is an easy way to sell your product without any charge with a high ROI.

People said the email marketing technique is not useful to sales. but it’s not real today in 2021 almost all people use email. So we can easily reach out to them and increase sales using email marketing.

First, know the term What is email marketing?

  • Email marketing is an effective digital marketing strategy to send emails to customers related to product sales and increase sales using email marketing.

The importance of email marketing for increase sales

Email marketing is the two-way communication channel

  • Email marketing is the two-way communication channel where people send a reply back to your mail easily so communication is faster and you can easily sell your product and increase sales using email marketing.

Your own email list

  • In some social media, sometimes your account is banned with large community fans but email marketing is the only way to create your own email list so no one can ban you or nobody can take your leads away from you.

Email use for better conversion

  • Email marketing has a huge ROI(Return of Investment) of 4400%. No one social media has a huge ROI like email marketing. Do you think you can increase your sales using email marketing?

  • Every person wants to increase sales using email marketing with high profit.

4 Ways to do email marketing and increase your sales

Built an email list

  • Build an email list of subscribers who are interested in what you are offering. The best way to create an email marketing list is to create a personal audience and send mail to them.

  • First, think of an email list. All the people are your customers and some of them are from different niches. They don’t like to receive from unrelated or different topics for a niche.

  • So, build an email list of those who are interested in your product.

Maximize your email list

  • You know more people coming out to your website, offer the customer free templates, checklists, eBooks, etc.

  • The most ideal approach to create drives that are really inspired by your item is by offering a lead magnet that tackles an issue for customers. For the most part, lead magnets are digital books, agendas, or exhaustive aides that your crowd can use to determine a problem area identified with your business.

Segment your lead list

  • Do not directly sell your product because nobody can purchase a product for you.

  • First, know the customer interest and send 4 to 5 emails or offer some on your product.

  • After customers are convinced about your product then sell your product.

Ensure email is delivered or not

  • After sending an email, whether the email is delivered or not.

  • Is the best way to increase sales using email marketing
July 27, 20212 minutesauthorAnkit Kalathiya
5 Easy ways to create a Backlink for Website

Today I’m going to show you 5 easy ways to create a backlink for a website. If you do apply this method I'm sure to get a quality high-domain authorities website backlink.

At this time, all people want their website to rank 1st in google ranking.

If you want to rank your website in google 1st, create a backlink from a high authority site.

So let’s get started with 5 easy ways to create a backlink for a website.

1. Article Submission

What is article submission?

Article submission is the process to submit your article to high-quality websites or directories to improve SEO ranking and get traffic to websites.

Some free sites are available for submitting an article.

Article submission is one of the easy ways to create backlinks for a website.

Why Article submission important from a backlink point of view?

Article submission is an effective off-page SEO technique.

Using Article submission you can get quality backlinks from high domain authorities websites which use to get traffic to your website and improve SEO ranking.

How to submit an article to a free article submission site?

  • Check article submission site DA & PA.
  • Register on the article submission site.
  • Choose the category of your article.
  • Include your article or website link in the author’s description box. It’s the most important step.
  • Submit your article
  • Check if your article is published or not.

Here is some site to submit Free Article

  • Articlebiz

  • Articles Factory

  • Tumblr

  • Quora

  • Apsense

2. Quora Answering

What is Quora Answering?

Quora answering is the site where users can ask questions related to their queries. And people can answer a user's query in quora.

What is the DA of quora?

  • DA: 93

Why is Quora useful for backlinks?

People can answer user’s queries in quora. And put their website link or article post link.

It’s a type of backlink. When users click on that link they redirect to your site.

Quora is an easy way to create a backlink for your website.

Using Quora you can create a high-quality backlink.

Quora backlink is also affecting traffic to your website means increased traffic to your website and improve your SEO ranking using create a backlink from quora.

Guideline to create a backlink on quora

  • Do not create a backlink
  • First some answers to user’s queries
  • The recommended way is to answer 5 user’s queries and create links to only a maximum of two of them.
  • If you create all answers with your link then quora can ban you.

How to create a backlink from quora?

  • Create an account on quora
  • Answer user’s queries
  • Create a link to your article.
  • It’s a Nofollow backlink for your website.

All quora backlink is nofollow means It’s used to increase traffic for your website but google crawler can not read backlink because it’s nofollow.

3. Social Bookmarking

What is social bookmarking?

Social bookmarking is sites where a user submits their blog post, article, videos, etc.

Why use social bookmarking for SMM?

Social bookmarking sites where social media marketing managers find posts to their relevant topic. It’s Important to reach our posts through social media to more people and get traffic from them.

How to use a social bookmarking site to create backlinks?

  • Create an account
  • Submit your site
  • Create a backlink

Here are some sites of social bookmarking

  • Reddit

  • Scoop it

  • Metafilter

  • Solo

  • Bookmarktou

It’s an easy way to create a backlink for your website. In social bookmarking sites some backlinks are dofollow and some backlinks are nofollow.

4. Directory Submission

What is directory submission?

Directory submission where you can submit your site URL and details about your website to increase link building for your site.

A web directory is a kind of a website that has some categories, sub-categories. You can submit your site to a category of your niche.

Why is direct submission important for link building?

Using directory submission you can create high-quality backlinks from some high-domain authorities. It’s useful to get more traffic to your website and improve SEO ranking.

Types of Web Directory

  • Paid and featured listing
  • Regular link with reciprocal link
  • Free and regular listing

How to use the Directory Submission site to create backlinks?

  • Create an account
  • Select a free and regular listing option
  • Submit detail about your website
  • Create backlinks

Here are some sites of social bookmarking

  • Somuch

  • Marketinginternetdirectory

  • Prolinkdirectory

  • Bedwan

  • Livepopular

5. Ping Submission

Ping Submission is a mechanism of sending auto generated notifications to google spider.

It is one type of SEO tool. Where you can submit your blog post or website to get backlinks.

What are the benefits of Ping submission?

  • Improve SEO ranking
  • Useful for site indexing
  • Easy ways to create backlinks
  • Also, use for improving search engine result pages

How to get backlinks using ping submission?

  • Create an account on the ping submission site
  • Submit a blog post to the relevant category
  • Get a backlink
  • Not submit more than 3 same URLs on one ping submission site

Ping Submission Site

  • Pingomatic

  • Pingmylinks

  • Pingmyblog

  • Pingler

  • Ping

Conclusion:

In this topic 5 easy ways to create a backlink for a website, if you read the whole blog post you have an answer on how to create backlinks. I hope your problem will be solved on this topic.

July 24, 20214 minutesauthorMilan Gangani
How to use laravel multi tenant (stancl/tenancy) with single DB ?

Nowadays multi-tenant applications are more useful than single-tenant applications. We can use multi-tenant with multiple databases or single databases as per our need. But it's better to use a single DB with a multi-tenant when you have a small application.

In this tutorial, we are going to use multi-tenant with a single database.

We will implement multi-tenant with single DB by using the following package: https://github.com/archtechx/tenancy

Assuming you already have Laravel 8 repo setup. Now please follow the given steps to implement multi-tenancy with a single DB.

Package Installation

Run following commands :

  1. composer require stancl/tenancy

  2. php artisan tenancy:install

  3. php artisan migrate

Add following service provider to config/app.php

App\Providers\TenancyServiceProvider::class

Create Custom Model

Now create modal named MultiTenant into app\Models

MultiTenant.php

 SavingTenant::class,
        'saved'    => TenantSaved::class,
        'creating' => CreatingTenant::class,
        //        'created' => TenantCreated::class,
        'updating' => UpdatingTenant::class,
        'updated'  => TenantUpdated::class,
        'deleting' => DeletingTenant::class,
        'deleted'  => TenantDeleted::class,
    ];
}

Update Tenancy Configuration

As we have added custom model we also need to define that model into config/tenancy.php

Please change tenant_model value to our custom model.

'tenant_model' => \App\Models\MultiTenant::class,

Add Resolver

To use multi tenant with single DB we also need to add our customer resolver, that will be used into Middlewares that we will create ahead.

Create MultiTenantResolver into app\Resolvers

App\Resolvers\MultiTenantResolver.php

find(Auth::user()->tenant_id)) {
            return $tenant;
        }

        throw new TenantCouldNotBeIdentifiedByPathException($id);
    }

    public function getArgsForTenant(Tenant $tenant): array
    {
        return [
            [$tenant->id],
        ];
    }
}

Add Middleware

We will create our custom middleware that will set the current tenant into cache, and that will used by package to fire default query where('tenant_id', "tenant id we have set into middleware")

App\Http\Middleware\MultiTenantMiddleware.php

tenancy = $tenancy;
        $this->resolver = $resolver;
    }

    /**
     * Handle an incoming request.
     *
     * @param  Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $tenant = Auth::user()->tenant_id;

        return $this->initializeTenancy(
            $request, $next, $tenant
        );
    }
}

Also, don't forget to add middleware alias into App\Http\kernel.php

 protected $routeMiddleware = [
        ..............
        'multi_tenant' => MultiTenantMiddleware::class,
];

Now we will apply this multi_tenant middleware to our routes.

Add Trait to tenant-specific models

We have to add BelongsToTenant trait to all of our tenant-specific models.

Say if we want to add tenant_id into the users table then we must have to add BelongsToTenant to the app\Models\User model.

That trait will by default add following query everytime when we will try to fetch records or update records.

Where('tenant_id', 'tenant id will taken from cache')

Add tenant_id to tenant-specific migrations

As we have added the tenant trait, we must have to add tenant_id into tenant-specific migrations as specified below.

public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            ...........................

            $table->string('tenant_id');

            $table->foreign('tenant_id')
                ->references('id')
                ->on('tenants')
                ->onUpdate('cascade')
                ->onDelete('cascade');

            $table->timestamps();
        });

Update TenancyServiceProvider

Replace the App\Providers\TenactServiceProvider by the following code.

 [],
            Events\TenantCreated::class => [
                JobPipeline::make([
                    Jobs\CreateDatabase::class,
                    Jobs\MigrateDatabase::class,
                    // Jobs\SeedDatabase::class,

                    // Your own jobs to prepare the tenant.
                    // Provision API keys, create S3 buckets, anything you want!

                ])->send(function (Events\TenantCreated $event) {
                    return $event->tenant;
                })->shouldBeQueued(false), // `false` by default, but you probably want to make this `true` for production.
            ],
            Events\SavingTenant::class => [],
            Events\TenantSaved::class => [],
            Events\UpdatingTenant::class => [],
            Events\TenantUpdated::class => [],
            Events\DeletingTenant::class => [],
            Events\TenantDeleted::class => [
                JobPipeline::make([
                    Jobs\DeleteDatabase::class,
                ])->send(function (Events\TenantDeleted $event) {
                    return $event->tenant;
                })->shouldBeQueued(false), // `false` by default, but you probably want to make this `true` for production.
            ],

            // Domain events
            Events\CreatingDomain::class => [],
            Events\DomainCreated::class => [],
            Events\SavingDomain::class => [],
            Events\DomainSaved::class => [],
            Events\UpdatingDomain::class => [],
            Events\DomainUpdated::class => [],
            Events\DeletingDomain::class => [],
            Events\DomainDeleted::class => [],

            // Database events
            Events\DatabaseCreated::class => [],
            Events\DatabaseMigrated::class => [],
            Events\DatabaseSeeded::class => [],
            Events\DatabaseRolledBack::class => [],
            Events\DatabaseDeleted::class => [],

            // Tenancy events
            Events\InitializingTenancy::class => [],
            Events\TenancyInitialized::class => [
//                Listeners\BootstrapTenancy::class,
            ],

            Events\EndingTenancy::class => [],
            Events\TenancyEnded::class => [
                Listeners\RevertToCentralContext::class,
            ],

            Events\BootstrappingTenancy::class => [],
            Events\TenancyBootstrapped::class => [],
            Events\RevertingToCentralContext::class => [],
            Events\RevertedToCentralContext::class => [],

            // Resource syncing
            Events\SyncedResourceSaved::class => [
                Listeners\UpdateSyncedResource::class,
            ],

            // Fired only when a synced resource is changed in a different DB than the origin DB (to avoid infinite loops)
            Events\SyncedResourceChangedInForeignDatabase::class => [],
        ];
    }

    public function register()
    {
        //
    }

    public function boot()
    {
        $this->bootEvents();
//        $this->mapRoutes();

        $this->makeTenancyMiddlewareHighestPriority();
    }

    protected function bootEvents()
    {
        foreach ($this->events() as $event => $listeners) {
            foreach (array_unique($listeners) as $listener) {
                if ($listener instanceof JobPipeline) {
                    $listener = $listener->toListener();
                }

                Event::listen($event, $listener);
            }
        }
    }

    protected function mapRoutes()
    {
        if (file_exists(base_path('routes/tenant.php'))) {
            Route::namespace(static::$controllerNamespace)
                ->group(base_path('routes/tenant.php'));
        }
    }

    protected function makeTenancyMiddlewareHighestPriority()
    {
        $tenancyMiddleware = [
            // Even higher priority than the initialization middleware
            Middleware\PreventAccessFromCentralDomains::class,

            Middleware\InitializeTenancyByDomain::class,
            Middleware\InitializeTenancyBySubdomain::class,
            Middleware\InitializeTenancyByDomainOrSubdomain::class,
            Middleware\InitializeTenancyByPath::class,
            Middleware\InitializeTenancyByRequestData::class,
        ];

        foreach (array_reverse($tenancyMiddleware) as $middleware) {
            $this->app[\Illuminate\Contracts\Http\Kernel::class]->prependToMiddlewarePriority($middleware);
        }
    }
}

Create / Fetch Tenant

Now we have to create a tenant and give that tenant_id to related users.

each user contains their specific tenant_id.

Use the following code to create a tenant :

 $tenant1 = \App\Models\MultiTenant::create([
     'name' => 'Tenant 1'
 ]);

 $tenant2 = \App\Models\MultiTenant::create([
     'name' => 'Tenant 2'
  ]);

That will create tenant into tenants table and values will be stored into data column as a son.

$tenant1 = App\Models\MultiTenant::where('data->name', 'Tenant 1')->first();

$tenant2 = App\Models\MultiTenant::where('data->name', 'Tenant 2')->first();

$tenant1User = User::where('id', 'user id here')->update(['tenant_id' => $tenant1->id]);

$tenant2User = User::where('id', 'user id here')->update(['tenant_id' => $tenant2->id]);

Now we have 2 tenants with 2 separate users who contain separate tenant ids.

Add Middleware to Routes

Now do login with User 1 and try to fetch all users from the database, it will return users of logged-in users' tenants only.

As we have the BelongToTenant trait into the User model.

Route::group(['middleware' => ['auth', 'multi_tenant']], function () { Route::get('users', function() {

 // only tenant-1 users will be returned because we are setting the logged-in user tenant into the cache from `multi_tenant`middleware.
 $allUsers = User::all();
});

});

You can use the same for other models too.

Hope this helps you.

August 14, 20212 minutesauthorVishal Ribdiya
SWOT Analysis - Strategic Planning

What we are going to cover

  • Introduction
  • What is SWOT Analysis?
  • Why perform the SWOT Analysis?
  • Factors

1. Introduction

What to do to be successful in any business? The obvious answer is Strategic Planning. Strategic Planning should be there. There are numerous tools and techniques for Strategic planning but one simple and effective framework is SWOT Analysis, it's also known as SWOT Metrix.

2. What is SWOT Analysis?

SWOT Analysis is one of the most commonly used tools to assess the internal and external environment of the company.

SWOT Analysis is a part of the company's Strategic Planning Process and Decision Making Process

SWOT Analysis can be done for an entire organization, Individual, particular Project, Product, industry.

SWOT Analysis plays a significant role in Decision making as it introduces opportunities to the company and it is the "Forward-Looking Bridge" to generate Strategic alternatives.

SWOT Analysis is a Two-by-Two grid form, in this diagram, in particular, each quadrant identifies strengths, weaknesses, opportunities, and treats.

3. Why SWOT Analysis?

Another question is why SWOT Analysis is significant?

Undoubtedly, the answer is SWOT Analysis allows you to identify

  • What your organization does well
  • Where it could improve
  • What Challenges your business is facing.
  • What Opportunities are available and it would be helpful in upcoming years

After Identify these things you would be able to-

  • Develop and implement Roadmaps
  • Timelines for potential Solutions
  • Budgetary plans
  • Manpower Requirement
  • Mid to long term strategic planning

I guess it's enough to understand the SWOT Analysis let's move ahead with the explanation of SWOT Analysis

4. Factors

2021-07-24-60fc12d4d0527

SWOT Analysis Framework has two dimensions.

  • INTERNAL FACTORS
  • EXTERNAL FACTORS

1. INTERNAL FACTORS

Internal factors are the strengths and weakness

  • Strengths ( Internal Positive Factor)
  • It gives the business its competitive advantages. Weakness (Internal Negative Factor)
  • It gives the business its weak points that a company needs to overcome to improve its performance.

Internal Factors include:

  • Company Culture
  • Company Image
  • Organizational Efficiency
  • Operational Capacity
  • Brand Awareness
  • Market Share
  • Financial Resources
  • Key Staff
  • Organization Structure.

2.EXTERNAL FACTORS

External factors are Opportunities and Threats.

Opportunities (External positive Factor)

  • It is an element that the company can see in the outside environment where the company can see what it could pursue in future to generate revenue.

Threats (External Negative Factor)

  • It's the element in the External environment that can prevent achieving its Goals or its mission or generate revenue or creating value

External Factors include

  • Customers
  • Competitors
  • Economic Environment
  • Government Rules and Regulations
  • Partners
  • Market Trends

To know more about the SWOT Analysis, kindly read my upcoming Blog.

July 28, 20212 minutesauthorMariyam Bemat
How to make a Progressive Web App

What is a PWA?

A Progressive Web App (PWA) is a hybrid of a regular web page and a mobile application. A PWA combines features offered by most modern browsers with the benefits of the mobile experience. They are built using standard web technologies, including HTML, CSS, and JavaScript. The functionalities include working offline, push notifications, and device hardware access and enabling creating user experiences similar to native applications.

How to make a PWA

Following Below steps

  • Create an app manifest.json file
  • Add it to your base HTML template
  • Create the service worker
  • Serve the service worker on the root of the scope you used in the manifest
  • Add a block to your base HTML template file
  • Site deploy in your server

Create an App Manifest

  • Add the following information in 'manifest.json'
 {
    name: `Name`,
    short_name: `Sort name`,
    start_url: `/`,
    display: `standalone`,
    icon:  `Favicon icon`,
    icons: [
       {
        "src": "icon by size",
        "sizes": "144x144",
        "type": "image/png",
        "purpose": "any"
      },
      {
        "src": "icon by size",
        "sizes": "192x192",
        "type": "image/png",
        "purpose": "maskable"
      },
      {
        "src": "icon by size",
        "sizes": "512x512",
        "type": "image/png",
        "purpose": "maskable"
      }
    ],
  theme_color: `Theme color`,
  background_color: `Background color`,
  ]
 }
  • Manifest.json file in add this type of code including name, short_name, start_url, display, icon, icons, theme_color, background_color.

Add the Manifest to Your Base HTML Template

  • Add the following line in yore 'index' file

Create offline.html as an Alias to index.html

By default, the service worker code below will render /offline.html instead of any resource it can't fetch while offline. Create a file at /offline.html to give your user a more helpful error message, explaining that this data isn't cached and the user is offline.

Create a Service Worker

  • Create one file in yore root (sw.js)
  • Link the sw.js file in the body tag

We have created some pages like

  1. Home page (/)
  2. Blog page (/blog)
  3. Contact information (/contact)
  4. Resume (/resume)
  5. offline.html
  • Add the code in your sw.js file
self.addEventListener("install", function(event) {
   event.waitUntil(preLoad());
});

 var preLoad = function(){
  return caches.open("offline").then(function(cache) {
    return cache.addAll(["/blog/", "/blog", "/", "/contact", 
 "/resume", "/offline.html"]);
    });
 };

 self.addEventListener("fetch", function(event) { event.respondWith(checkResponse(event.request).catch(function() 
  {
     return returnFromCache(event.request);
   }));
   event.waitUntil(addToCache(event.request));
  });

  var checkResponse = function(request){
   return new Promise(function(fulfill, reject) {
     fetch(request).then(function(response){
       if(response.status !== 404) {
         fulfill(response);
       } else {
         reject();
       }
     }, reject);
   });
  };

  var addToCache = function(request){
   return caches.open("offline").then(function (cache) {
     return fetch(request).then(function (response) {
       console.log(response.url + " was cached");
       return cache.put(request, response);
     });
   });
  };

  var returnFromCache = function(request){
   return caches.open("offline").then(function (cache) {
     return cache.match(request).then(function (matching) {
      if(!matching || matching.status == 404) {
        return cache.match("offline.html");
      } else {
        return matching;
      }
     });
   });
  };
  • Servicer worker file add your body tag

load the service worker file in

<script>
   if (!navigator.serviceWorker.controller) {
   navigator.serviceWorker.register("/sw.js").then(function(reg) {
         console.log("Service worker has been registered for scope: " + reg.scope);
     });
 }
 </script>

Last step

  • Deploy code in yore live site
  • Create lighthouse report and check PWA
July 28, 20214 minutesauthorVatsal Sakariya
How to setup React in Laravel

In this article, I show you how to set up react application in Laravel Framework. as you know react is a very flexible frontend library and works with together any backend framework, so let start and follow the following steps. I hope you have created the laravel application.

You can watch the following video tutorial or follow this article as well,

Step 1:

Let's go to the resource directory in laravel. now let's create react application. you should watch the following tutorial if you don't know how to create react application.

Step 2:

Merge the package.json and package-lock.json files in the root. fire npm install && npm run dev command in terminal for compile react application to js.

Step 3:

In this step, you need to set up a webpack.mix.js file. put the following code in the webpack.mix.js file.

mix.options({
  postCss: [
      require('autoprefixer'),
  ],
});

mix.setPublicPath('public');

mix.webpackConfig({
  resolve: {
      extensions: ['.js', '.vue'],
      alias: {
          '@': __dirname + 'resources'
      }
  },
  output: {
      chunkFilename: 'js/chunks/[name].js',
  },
}).react();

// used to run app using reactjs
mix.js('resources/react-app/src/index.js', 'public/js/app.js').version();
mix.copy('resources/react-app/public', 'public');

NOTE: Don't forget to change the index.js path based on your application name

Step 4:

Let's add <div id="root"></div> to your application's root blade file

Step 5:

Let's inlude <script type="text/javascript" src="{{ mix('js/app.js') }}"></script> to your application's root blade file before end the body tag.

So, the Basic setup is done. enjoy react with laravel.

December 15, 20213 minutesauthorShailesh Ladumor
How to add project as a library to Android Studio

But if you want to add another project as a library in your application. For that, you need to add that library project to your application as a module dependency.

1. Open Your Project in Android Studio.

2. You will find the two main directory name samples and others.

3. Go to Android Studio and navigate to File -> New -> Import Module -> Select the library path -> Finish.

2021-07-24-60fbb0d6a0a7c

4. Import-Module from Directory.

2021-07-24-60fbb6e95102d

5. Then right-click on the App directory -> Open Module Settings -> Dependencies -> Click on + button inside Declared Dependencies -> Module Dependency -> Select your library -> Ok.

2021-07-24-60fbb90b68dec

2021-07-24-60fbb99dd54e3

Another way to add Module Dependency

  • Open build.gradle Of the main module
dependencies {

implementation project(":sample")

}

There can be a situation when we need to modify the library code according to our requirement then in that case we can follow this method.

July 25, 20212 minutesauthorVivek Beladiya