How to add Elfsight widget to Laravel website
To add Elfsight widget to your Laravel website, you need the installation code. Here is an article that explains where to get it - Where to get Elfsight widget installation code.
In this article
- Adding inline widgets to specific page (home page, contact, etc.)
- Adding floating widgets to all pages
Adding inline widgets to specific page
- 1
-
Go to the admin panel of your Laravel website's hosting
Log in to the admin panel of your website's hosting and find your file manager.Note:
To find out the location of your file manager and Laravel project, please contact your hosting provider.
For this article, we will use Elasticweb hosting.
To find the file manager in Elasticweb hosting, click Nodes tab (1) and choose Node file manager (2):
- 2
-
Open your Laravel project
In our case, the Laravel project is located in the domains folder:Then click on your Laravel project:
- 3
-
Find the pages for customization
To do it, you need to go to the resources → views folder: - 4
-
Paste the installation code
Click Edit next to the needed page:Note:
All the names of the files may be different for each website. We take the page contact.blade.php as an example.
You need to choose the page where you want to install the widget.
Add the installation code to the place where you want to see the widget:
You have successfully added your Elfsight widget to a specific page of your Laravel website!
Adding floating widgets to all pages
- 1
-
Go to the admin panel of your Laravel website's hosting
Log in to the admin panel of your website's hosting and find your file manager.Note:
To find out the location of your file manager and Laravel project, please contact your hosting provider.
For this article, we will use Elasticweb hosting.
To find the file manager in Elasticweb hosting, click Nodes tab (1) and choose Node file manager (2):
- 2
-
Open your Laravel project
In our case, the Laravel project is located in the domains folder:Then click on your Laravel project:
- 3
-
Find the pages for customization
To do it, you need to go to the resources → views folder: - 4
-
Paste the installation code
Click Edit next to the root file:Note:
In our specific example, there is a main.blade.php file, which is the root for all other pages of the site.
Find your root folder and paste the installation code.
Add the installation code after the opening <body> tag:
You have successfully added your Elfsight widget to all pages of your Laravel website!