Our Latest Blog Posts

latest-post

Businesses are always looking for new ways to improve efficiency and promote smoother customer service. A relatively new trend that has become popular over the past several years is using ChatGPT, a next-level chatbot based on OpenAI's language models. ChatGPT humanizes responses with a chorus of text. Text responses are human-made personas. This often quickly revolutionizes how businesses interact with their customers.

Understanding the Role of ChatGPT in Business

So, let us start with the basics of ChatGPT before discussing how to customise it and what it can do for you. ChatGPT is a question answering language model that leverages the power of deep learning algorithms to craft human-like responses for addressing user queries. These models utilise a huge dataset of text from the internet to produce coherent and contextually related answers.

One of the most important strengths of ChatGPT is its ability to perform a diverse range of functions, such as responding to FAQs or giving suggestions. Businesses spanning a broader array of industries could utilise it in different ways thanks to its flexibility.

The Basics of ChatGPT

How does ChatGPT work with input and output? Users will type in their questions or ask the chatbot, and ChatGPT then replies with a suitable answer based on its understanding of all text. Usually facilitated by a chat interface built into a website or app.

ChatGPT's amazing ability to mimic human conversation often convinces users that they are talking to a real person. Human-like behaviour is made possible by a combination of pre-training on a wide range of text data and fine-tuning on specific custom datasets.

The Importance of Customization in Chatbots

Even though ChatGPT provides a powerful out-of-the-box solution, customization is an essential part of leveraging its full potential for business use. Adjusting the chatbot to your brand’s tone and specific needs is effective for improving customer satisfaction and making the human-computer interaction more personalised.

First, customization helps businesses in creating a chatbot that fits their brand needs. Over time, a chatbot is likely to communicate with hundreds or thousands of customers, and for a business, it is important to retain a high level of customer recognising the brand. A well-customised chatbot will speak with a customer using a language, tone, and style specific to a brand, and this will positively affect the customer recognition of a brand.

Second, customization is also highly useful for training ChatGPT to be a more competent assistant in a specific industry. For example, it can be trained on specific medical terms and how to respond to patients’ queries in the medical field. The same can be said about an e-commerce field: after customisation, an e-commerce chatbot will have a chance to provide a customer with more specific information, such as tailored product recommendations, based on their product-viewing history and preferences.

In conclusion, while customization is a time-consuming process, it can help to create a chatbot that is not a generic assistant, but a truly unique one. The benefits attached to this will be heard in the level of customer satisfaction, the level of efficiency, and business profitability.

The Process of Customizing ChatGPT

Customizing ChatGPT requires a systematic approach to prevent the situation where existing functionality is upset by new features before customisation is complete. We need to take a look at the various steps involved in configuring ChatGPT so that it can serve your specific needs:

Identifying Your Business Needs

Before embarking on the customization journey, it's crucial to identify your business objectives and how ChatGPT can help achieve them. Whether you aim to automate repetitive tasks, provide instant responses to customer queries, or foster engagement, having a clear understanding of your business needs sets the foundation for successful customization.

Moreover, conducting market research and analysing customer feedback can provide valuable insights into the type of interactions your audience expects. By understanding your target demographic and their preferences, you can tailor ChatGPT to deliver personalised and relevant responses, enhancing the overall user experience.

Tailoring ChatGPT to Your Business

The first step after defining your objectives is to customise ChatGPT to be relevant to your company and cater to its unique needs. To do so, you will need to provide the chatbot with training data appropriate to your sector and domain.

Utilising a custom dataset consisting of examples of contextually relevant questions and answers derived from your faculty and fine-tuning properties will aid in generating responses that are accurate and contextually relevant. Finally, the model’s capabilities should always be tested, and its performance should be refined over time.

You can also facilitate the flow of data and improve the chatbot’s functionality by connecting ChatGPT to your CRM system or other platforms. The AI model relies on data from a variety of sources to provide users with more personalised solutions and suggestions, which boosts customer satisfaction and results in repeat business.

Benefits of Using Custom ChatGPT

Custom ChatGPT has tons of benefits that can make it go a long way in improving your business operations and customer experience. Let’s discuss,

Enhancing Customer Service

Businesses that want to be successful have quality customer service or personalised functionality gates. ChatGPT can be tailor-made to understand what your customers are asking and answer them accordingly, thus optimising the support process and helping resolve issues faster.

Additionally, ChatGPTs capacity to handle a high number of concurrent conversations enables businesses to serve multiple customers at the same time, leading to an even faster response and, therefore, helping maintain greater customer satisfaction! Say a customer has an intricate situation that needs minute-by-minute support. Not only does Custom ChatGPT know how to read the problem precisely, but it can also look for solutions piece by piece gratifying an enhanced customer service experience.

Streamlining Business Operations

With a Custom ChatGPT, internal operations can also turnaround as automating repetitive tasks and helping employees in their day-to-day jobs are some of the ways it can make an impact. By scheduling the appointment to give reports, these boring and tedious tasks can be done with ease from Chatbots freeing hours of workforce time so that your team can spend more energy on real work.

In addition to this, integrating ChatGPT with your CRM system means the chatbot can update you in real-time as customers interact and offer preferences or feedback. This kind of smooth integration helps various departments within an organization to manage data more efficiently and make better-informed decisions, ultimately leading to increased operational efficiency.

Potential Challenges and Solutions with Custom ChatGPT

The ability to customise ChatGPT is full of promise, however, there are limitations and hurdles that businesses should be mindful of as they start using it. Here, I will explain about two key issues along with their solutions,

Addressing Common Concerns

A typical fear with AI chatbots is that it can produce inaccurate outcomes which might lead to incorrect and misleading information. In order to offset this, businesses should establish sufficient testing coverage so as to approve the replies provided by ChatGPT. Monitoring, feedback loops and the escalation process are designed so that anything there is out of spec can be identified in near real time.

Reliability and accuracy of the answers that are given by AI chatbots is an essential thing to consider both for maintaining trust with customers keeping their satisfaction level high. This directly improves the responses ability which in turn making it more relevant to the new situation being discussed, for a business that employs chatbot developers and having them actively manage by continually updating training data gets better performance out of their chatbots. Also, a human-in-the-loop mechanism that allows the interference of manpower is also an additional layer for ensuring data quality.

Overcoming Implementation Hurdles

Although challenging, it is possible to roll out a custom version of ChatGPT by businesses that have little or no experience in AI implementations. That said, it becomes far easier to implement when working alongside established AI solution providers. These specialists can walk you through implementation and customization, provide the necessary training to your team to utilize it effectively, and constant support for managing change.

In addition, doing the proper research and analysis of your unique business needs prior to jumping into customization ensures as smooth a process as possible and avoids unnecessary roadblocks along way. When you work hand in glove with the AI-solution provider to set specific goals, develop KPIs and lay out a clear path it makes sure that whatever customization effort has been done is perfectly aligned with your business objectives.

Future Trends in Chatbot Technology

The evolution of chatbot technology continues to shape the future of customer interactions. Here are two trends that are expected to drive the development of custom ChatGPT:

AI and Machine Learning in Chatbots

The utilisation of AI and machine learning in chatbots renders them with the ability to learn from user interactions and become personalised over time. This journey of learning from transactions helps in enhancing the accuracy and responsiveness of your chatbot, thereby turning into a more dependable tool for businesses.

The Future of Custom ChatGPT in Business

With the development of technology, every successful business may profit significantly from using custom ChatGPT. No matter if it is used for creating unique marketing campaigns or more efficient support systems, it is apparent that the tool will help businesses interact with their customers better and, in some cases, be the defining factor of success.

Over the next several years, demand for chatbots such as with ChatGPT are expected to soar even higher, given an increasing portion of shopping and socialisation now occurs online. The world is coming to think of chatbots with AI and machine learning that can provide real-time personalised responses to customers on the GO from businesses.

Custom ChatGPT is far more than just the future of customer service. Modern healthcare, education, and plenty of other industries are now actively using chatbots to improve the efficiency of services, organise information in more digestible ways, and simply create exciting user experiences. This tool’s flexibility and adaptability will allow it to take the leading positions in numerous fields and adapt to the new requirements demanded by these industries.

Would you like to be among the first to try this innovation? Then try InfyGPT today!

September 07, 20249 minutesuserAnkit Kalathiya

Posts

Why you should learn Adobe Illustrator?

One of my tasks today was to create a banner and I thought to myself which software should I choose Adobe Photoshop or Illustrator and yes it is obvious that I have chosen Adobe Illustrator and later I decided to write you an article saying that you need Adobe Illustrator To convince you about why you should learn. You are a graphic designer or web developer.

The Big Muscles to Adobe Illustrator

You may think that learning Adobe Illustrator in 2021 is pointless since most of the work can be done on Adobe Photoshop, and with the release of Adobe XD there can be all layouts and planning. What does it mean after all? Well here are some of the things Adobe Illustrator does best but first

What is Adobe Illustrator?

Adobe Illustrator is a software developed and published by Adobe Inc. since 1987. At first, it was only available for Mac but in later years it was also available for Windows. It is used to create vector scalable graphics.

What is Vector Graphic you ask?

There are two types of 2D graphic vector and raster.

Raster Graphics

Raster graphics are made up of a grid of pixels, each of which can have a different color. The main drawback of this is that it can only be made smaller (the size can be reduced) but if you try to increase the pixels the image will become blurred. Ex: Digital photographs, icons, etc.

Adobe Photoshop is a raster graphic software used for editing these types of images.

Vector Graphic

Vector graphics are made in a simple way that can create shapes, letters, or any other line objects. They follow mathematical formulas that provide information about these lines, such as colors, and what shapes to form. This type of graphics can be measured infinitely and it will never lose design.

Now since that’s out of the way let’s get back to our main topic

Best for designing Logo

It is always better to design the locator in vector format so that you can resize any color as you like. Customers always zoom in, check out the detailed view of the logo, the vector graphic is easy to customize.

Exported to SVG

One of the best things about Adobe Illustrator is that it can be exported directly in the form of SVG so you don't have to worry about the best resolutions for websites.

Web Designing

Adobe Illustrator is really the best way to create wireframes (the basic structure of a website or application) and lay it out and has many built-in features to do so.

Create your custom font, cartoons, and artworks

Ever seen stylish-looking text or artwork on Instagram or any social media platform and wonder if I want to create something like that, but don’t know how? Here's your

answer: Learn Adobe Illustrator and you will be able to do it with practice.

How to make the font

  • Sketching: Sketch the letters by hand.
  • Tracing: Use the scanner to get that image into the system and open that image in Illustrator. Now trace the letters with the pen tool.
  • Reorganizing: Accurate, readability and Corning images you are looking at are refined and organized.
  • Saving: Save the glyph and export it using additional plug-ins.
  • Using: Put that new brand into your new design for good use.

Patterns with just a few repeats

Illustrator is the ACR of creating peters with repeat options. You repeat, reflect, and ask for spas between objects and your pattern is ready.

The Infographic

Infographics are a very popular way to illustrate a topic with shapes, budgets, some data, and text. Creating charts in Adobe Illustrator is easy, just need to enter and complete some values. Infographics can be easily designed in Illustrator. This infographic is also saved in EPS format which is best for printing.

Easy to Learn

Trying to learn Adobe Photoshop, your first week will be literally the hardest learning of all those shortcuts while learning Adobe Illustrator is fairly easy. No need to create new layers every time, in Adobe Illustrator you just do your work because you like that the whole screen is your work area (inside or outside the artwork).

In other words, what I'm trying to say is that Adobe Illustrator is software that can be used in most scenarios and gives you the freedom to express your creativity without having to wonder how color can fill in the blanks.

July 27, 20214 minutesauthorKishan Savaliya
Room Database in android java

Hi everyone, in this post, we will discuss Room Database in android java.

Below are all steps covered in this blog

  • How to use the Room database
  • How to add Room Database in android studio
  • Insert,Update,Delete record
  • How to pass query in Database

What is a Room?

  • The Room strong library provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.

  • Normally Room databases are fast created and have good performance like reading, updating and deleting records. Room Database makes everything easy and fast

  • Room Database more detail open this link: https://developer.android.com/training/data-storage/room/

Components of Room Here room have main 3 components

Entity:

  • Instead of creating the SQLite table, we will create the Entity. An entity is nothing but a model class annotated with @Entity. The variables of this class are our columns, and the class is our table.

Database:

  • It is an abstract class where we define all our entities.

DAO:

  • Stands for Data Access Objects. It is an interface that defines all the operations that we need to perform in our database.

Demo App Create

  • First, we create a new project in android studio.
  • Name of my project "Room DataBase"

Adding Dependencies

  • Add needed dependencies for the room database.
  • Android studio in this file add dependencies "build.gradle".
  • See the below image and add the latest version room database replace here "$room_version" add original version

First, we will create DAO class:

  • This DAO class-main work intermediary between the user and database. All performed operations are defined here.
  • Below create StudentDao class
@Dao
public interface StudentDao {

@Query("SELECT * FROM Student")
List<Student> getAll();

@Insert
void insert(Student student);

@Update
void updateTask(Student student);

@Delete
void deleteTask(Student student);
}

Nowhere explain all components of StudentDao Class

  • Compulsory add class upper "@Dao" keyword
  • Three methods create insert, update, delete
  • Most important thing here is "@Query"

What is a Query?

  • Using query to get database existing record.
  • @Query("SELECT * FROM Student") this query gets all student records.
  • But the user wants to get only the standard "5" student record and only get how to pass a query?
    @Query("SELECT * FROM STUDENT where std = :std")

    List<Student> dataCheck(String std);
  • Here "std" id table field name
  • Call this method "data check(String std)" pass a string in "5" and database in getting only 5 stander student record
  • So this concept use the query parameter

Second steps create student model class

@Entity(tableName = "student")
public class Student implements Serializable {

@PrimaryKey(autoGenerate  = true)
private int id;

@ColumnInfo(name = "std")
private int std;

@ColumnInfo(name = "name")
private String name;

public int getId() {
    return id;
  }

public void setId(int id) {
    this.id = id;
  }

public int getStd() {
    return std;
  }

public void setStd(int std) {
    this.std = std;
  }

public String getName() {
    return name;
  }

public void setName(String name) {
    this.name = name;
  }
}
  • PrimaryKey: auto increment values
  • tableName : user wants to set the table name
  • ColumnInfo: give the table in columns name

Third steps Create Database class:

@Database(entities = {Student.class}, version = 1)
public abstract class AppDatabase extends     RoomDatabase {
public abstract Student studentDao();
}
  • User wants to add multiple tables how can add like that:

@Database(entities = {Student.class,Abc.class,Xyz.class}, version = 1) public abstract class AppDatabase extends RoomDatabase { public abstract Student studentDao(); }

  • To create a new model class like Abc.class and Xyz.class etc same method.

Fourth step inserts, update and delete records create separate method:

 public class InsertUpdateDeletRecord {

    private String DB_NAME = "db_task";

    private Student Student;
    public studentRepository(Context context) {
        Student = Room.databaseBuilder(context, Student.class, DB_NAME).build();
    }

    public void insertTask(String std,String name) {

        insertTask(std, name);
    }

    public void insertTask(String std,String name) {
        Student student = new Student();
        student.setstd(std);
        student.setname(name);

        insertTask(student);
    }

    public void insertTask(final Student student) {
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... voids) {
                Student.daoAccess().insertTask(student);
                return null;
            }
        }.execute();
    }

    public void updateTask(final Student student) {
        student.setModifiedAt(AppUtils.getCurrentDateTime());

        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... voids) {
                Student.daoAccess().updateTask(student);
                return null;
            }
        }.execute();
    }

    public void deleteTask(final int id) {
        final LiveData<student> task = getTask(id);
        if(task != null) {
            new AsyncTask<Void, Void, Void>() {
                @Override
                protected Void doInBackground(Void... voids) {
                    Student.daoAccess().deleteTask(task.getValue());
                    return null;
                }
            }.execute();
        }
    }

    public void deleteTask(final student student) {
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... voids) {
                Student.daoAccess().deleteTask(student);
                return null;
            }
        }.execute();
    }

 }

Sample Implementation of basic CRUD operations using ROOM

Insert:

 InsertUpdateDeletRecord 
 insertUpdateDeletRecord = new 
 InsertUpdateDeletRecord(getApplicationContext( ));
 String std = "5";
 String name = Android";
 insertUpdateDeletRecord.insertTask(title, 
 description);

Update:

 InsertUpdateDeletRecord 
 insertUpdateDeletRecord = new 
 InsertUpdateDeletRecord(getApplicationContext( ));
 Student student = 
 insertUpdateDeletRecord.getTask(2);
 student.setName("Java");
 student.setStd("6");
 insertUpdateDeletRecord.updateTask(student);

Update:

 InsertUpdateDeletRecord 
 insertUpdateDeletRecord = new 
 InsertUpdateDeletRecord(getApplicationContext());
 insertUpdateDeletRecord.deleteTask(3);
July 25, 20214 minutesauthorPankaj Valani
How to test reCAPTCHA form - prepare yourself for bots !

Nowadays, people are hacking secure data systems, so will See the security testing criteria for reCAPTCHA forms.

reCAPTCHA is a technology that assesses the probability that the entity that uses your web code (page, app, portal, etc.) is a human and not a bot (or the other way around). Grabbing information of behavior (of a user or a bot) encapsulates it in the token that gets sent to your server. On your server, the token is being sent again to Google for returning the assessment on how probable it is that the token was generated by a human. Part of the response returned from Google to your server:

Let's See the points how to Test 🛠️

First, we validate from the frontend

On any reCAPTCHA from removing that div from inspect element and then trying to save, there must be valid and records should not store on the backend as shown in the image.

2021-07-22-60f90c027ead1

Remove this div then save the form there should be a validation message for reCAPTCHA verification and the form should not be saved, if the form is submitted then the data were stored in the data table which was False to the system.

Now Let's see how we validate from the postman

First, add testing form URL on browser and apply Post method and on body add all fields which are added in form lets see on the image.

2021-07-22-60f90c12e0f33

Now add on the header at Key column CSRF token, X-Requested, cookie and add its perspective value as shown in the image.

CSRF token and XSRF-TOKEN will store in the cookie which will get from the front page from inspect element.

2021-07-22-60f90c2315082

Now, click on send request and validate the status should be false as shown in the image

2021-07-22-60f90c3081ca1

If the status changes to true, then the data stored in a table & will create a problem, and the reCAPTCHA form will validate false.

Hence, reCAPTCHA form Test, Hope this helps.

July 22, 20214 minutesauthorBhumi Khimani
Fix 404 while reloading Gatsby Website for dynamic client-only route

Last week, we run into a problem for one of the large Gatsby + ReactJS + Laravel projects in hosting which is hosted with Apache Webserver on Amazon AWS EC2. The problem we were facing was, for some reason, when we reload the Gatsby website, it was giving a 404 error page.

If you open a home page and then a normal visit then the website will fully function, but if you reload the page then it gives an error. And we found it happens when we are using Dynamic routing of React Route in Gatsby as per show in Gatsby documentation here.

Also, what we found, if we test the website build with gatsby serve then it works fine. But while using Apache, it behaves differently and we found that this problem has been faced by lots of people over the internet.

So what we came up with is, we used gatsby serve with an apache proxy. Here is how we did it,

Step 1 - Setup Project

As a first step, clone the project on the server and run a command, gatsby build to create a gatsby build.

Step 2 - Setup PM2 for Gatsby Serve

The next step that we need to do is run gatsby serve. But as you know, we can not run this command directly via console, because as you exit from the console, the command will be terminated.

So we will be using pm2 package, a NodeJS utility that is used to run nodejs apps.

For that, we will need to install pm2 globally. Run the following command to install it,

npm install pm2 -g

You can find other installation ways here if you need.

Once the installation has been done, let's run the gatsby serve command via pm2. For that run the following command from the gatsby project folder,

pm2 start gatsby --name my-web-app -- serve

where my-web-app you can replace with the name of your app.

Once, it's running, try to test it, if it's working correctly by opening the URL http://your-ip-address:9000/. Make sure, port 9000 is opened on your server for traffic.

Step 3 - Configure Apache

Once, gatsby serve is working and tested. The next step is to configure apache to proxy all port 80 traffic to port 9000.

For that, edit your apache conf file (or virtual host conf file), and add the following lines (or configure it to something like the following),

<VirtualHost *:80>
        ServerName my-web-app.infyom.com

        ServerAdmin webmaster@infyom.com

        ProxyRequests On
        ProxyPass / http://localhost:9000/
        ProxyPassReverse / http://localhost:9000/

        ErrorLog ${APACHE_LOG_DIR}/my-web-app.infyom.com.error.log
        CustomLog ${APACHE_LOG_DIR}/my-web-app.log combined

        ......
        # any other options below as per your need
        ......
</VirtualHost>

The next step you need to do is restart your apache server by,

sudo service apache2 restart

And then you can just open the URL https://my-web-app.infyom.com and it should work fine.

Bonus

New Deployment

Whenever you deploy a new code, you again need to run gatsby build and then pm2 restart my-web-app. Then only it will take new changes.

Troubleshooting

Sometimes, we found that we need to restart apache as well after the new deployment. so if you run into any trouble, then make sure to restart apache as well and it should solve the problem.

I hope it may help you to resolve your 404 problem.

July 16, 20213 minutesauthorMitul Golakiya
How to generate User Device API using Laravel One Signal

Generally, we are using a Laravel One Signal package for push notification. if you are planning to use one signal in the mobile application then this package right for you.

Recently, I add a new feature UserDevice. let me explain why I added support for user Device APIs.

We need to create an API to register a device because One Signal sends a push notification using os player id. so, we need to store os_player_id in the backend from the mobile application. So, need to create an API for it.

Now. you can save your time using this package. you can Generate APIs using one artisan command,

php artisan one-signal.userDevice:publish

This command generates the following files,

  • UserDeviceAPIController
  • UserDeviceAPIRepository
  • UserDevice (model)
  • Migration So, everything is ready in minutes and delivered an API on the spot.

Also, do not forget to add the following routes to the api.php file.

use App\Http\Controllers\API\UserDeviceAPIController;

Route::post('user-device/register', [UserDeviceAPIController::class, 'registerDevice']);
Route::get('user-device/{playerId}/update-status', [UserDeviceAPIController::class, 'updateNotificationStatus'])
July 08, 20212 minutesauthorShailesh Ladumor
How to generate pre-signed URL from s3 bucket ?

People nowadays are becoming more intelligent, so better to protect our application's content/data from those who are calling themself hackers.

One of the best examples is the data URLs from AWS buckets. it's not a good idea to store sensitive data into a public AWS Bucket, as the URL is accessible by the people.

Of Course, you can store profile avatars and others data to the public bucket's that not contains any confidential information. so that's fine.

But when it's about confidential information like PAN CARD Details, AADHAR Card Details, Bank Informations we Must Recommend using AWS Protected Bucket.

In this tutorial, we are going to show that how we can prevent that kind of case, Or how we can integrate AWS Protected Bucket in our Laravel Application.

The following code will help you to generate a pre-signed AWS URL that will prevent our data, that URL is non-guessable and it will expire within some minutes/hours specified by us.

So let's start with some code :

$s3 = \Storage::disk(config('filesystems.s3_protected_disk'));
$client = $s3->getDriver()->getAdapter()->getClient();
$expiry = "+1 minutes";
$command = $client->getCommand('GetObject', [
  'Bucket' => \Config::get('filesystems.disks. s3_protected_disk.bucket'),
      'Key'    => 'Path to your file',
    ]);
$request = $client->createPresignedRequest($command, $expiry);
    return (string) $request->getUrl();

So here we have created an s3 instance and it's stored on the $s3 variable, we have specified the expiry time as 1 minute so the given URL for data will be expired within a minute.

Also, we have to specify the bucket name and path to our protected file to generate AWS pre-signed URL.

It will return the pre-signed URL and its looks like as the following URL.

https://pre-signed.s3.au-west-2.amazonaws.com/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxx%2F20180210%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210210T171315Z&X-Amz-Expires=60&X-Amz-Signature=xxxxxxxx&X-Amz-SignedHeaders=host

Hope this helps.

July 16, 20212 minutesauthorVishal Ribdiya
How to display responsive image in different devices

Today we are going to see how we can image based on resolution. We have the most common issue of loading big images in small devices take time. So, the basic solution is to use the picture element to load a different image in different devices and resolutions.

The <picture> element will be for the art direction of responsive design.

The element contains two tags.

  • <source>
  • <img>

So, the browser will look for the first <source> element where the media query matches the current width, and then it will display the image. The <picture> element is required as the last child of the <picture> element.

Let me show you an example of how to display a different image in different widths.

Here is a Code example,

<picture>
    <source media="(min-width:900px)" srcset="infyom_logo_lg.jpg">
    <source media="(min-width:700px)" srcset="infyom_logo_md.jpg">
    <source media="(min-width:500px)" srcset="infyom_logo_sm.jpg">
    <img src="infyom_logo_xl.jpg" alt="Flowers" style="width:auto;">
</picture>
June 18, 20211 minuteauthorShailesh Ladumor
How to setup passwordless Login In Laravel
Parsed in 0.31 ms or 2 times faster

Basically, we set up email/username and password login in all our projects. but, sometimes we need to implement s passwordless login in the laravel application,

First of all, what is passwordless login? passwordless login is an authentication method that allows the user to log in without entering a password.

In this article, I show you how to set up passwordless login laravel step by step.

Step 1:

one great laravel package Laravel Passwordless Login provides the ability to log in without a password.

This package provides a temporary signed URL link that logs in a user, What it does not provide is a way of actually sending the link to the route to the user. This is because I don't want to make any assumptions about how you communicate with your users.

Step 2:

Open the terminal and go to the project directory and fire the following command to install

composer require grosv/laravel-passwordless-login

Step 3:

Configure the following variables in your env file

  LPL_USER_MODEL=App\User
  LPL_REMEMBER_LOGIN=false
  LPL_LOGIN_ROUTE=/magic-login
  LPL_LOGIN_ROUTE_NAME=magic-login
  LPL_LOGIN_ROUTE_EXPIRES=30
  LPL_REDIRECT_ON_LOGIN=/
  LPL_USER_GUARD=web
  LPL_USE_ONCE=false
  LPL_INVALID_SIGNATURE_MESSAGE="Expired or Invalid Link"

Step 4:

Create one function in your login controller. it looks like

use App\User;
use Grosv\LaravelPasswordlessLogin\LoginUrl;

function sendLoginLink(\Request $request)
{
    $user = User::where('email','=', $request->get('email))->first();

    $generator = new LoginUrl($user);
    $url = $generator->generate();

    //OR Use a Facade
    $url = PasswordlessLogin::forUser($user)->generate();

    $data['url'] = $generator->generate();
    $data['user'] = $user;

    Mail::to($user->email)->send(new UserLoginMail($data));

    return back();
}

Step 5:

Set following route in your web.php

Route::post('/user/login', [LoginController::class, 'sendLoginLink'])->name('userLogin');

Step 6:

Create one mailable. you can refer to a doc if not familiar. Also, fire the following command to create a mailable

php artisan make:mail UserLoginMail

Step 7: Create an Email UI as per your requirement.

April 02, 20212 minutesauthorShailesh Ladumor