Category Archives: Laravel

Laravel Tutorials

Laravel 8 Botman Chatbot Tutorial Example

In this Laravel 8 Botman Chatbot Tutorial Example tutorial I will show you how to install or integrate botman chatbot in laravel 8 application. In this tutorial you will learn to integrate and install botman chatbot in laravel 8. In this article I will share example to integrate botman chatbot in laravel 8 application.

Laravel 8 Botman Chatbot Tutorial Example

In this step by step tutorial I will demonstrate you how to integrate botman chatbot in laravel 8 application.Please follow the instruction given below:

  • Step 1 – Install Laravel 8 App
  • Step 2 – Connecting App to Database
  • Step 3 – Install Botman and Botman Driver
  • Step 4 – Create Configuration File
  • Step 5 – Add route
  • Step 6 – Create Controller by Artisan Command
  • Step 7 – Create Blade File
  • Step 8 – Run Development Server

Step 1 – Install Laravel 8 App

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Step 2 – Connecting App to database

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Step 3 – Install Botman and Botman Driver

In this step we will install botman and botman driver in laravel. Run following command to install botman composer package:

Install Botman:

Install Botman Driver:

Step 4 – Create Configuration File

In this step we will create configuration file for driver and cache.

config/botman/config.php

config/botman/web.php


Now, run following command to migrate database schema.

Step 5 – Add route

After this, we need to define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Step 6 – Create Controller by Artisan Command

Now, lets create a controller named BotManController using command given below –

Now, go to app/http/controller/BotManController.php. and update the following methods into your controller file:

Step 7 – Create Blade File

In this step we will create blade view file. Go to resources/views directory and open file that named welcom.blade.php. Then put the following html and javascript code into this blade view file:

Step 8 – Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Laravel 8 Full Text Search using Ajax Example

In this Laravel 8 Full Text Search using Ajax Example Tutorial I’ll show you how to implement ajax full text search in laravel using full text search package. In this tutorial we will guide you step by step on how to implement ajax full text search in laravel using full text search package. In this tutorial I’ll guide you with example of creating ajax full text search with mysql DB in laravel app.

Laravel 8 Full Text Search using Ajax Example

In this step by step tutorial I will demonstrate you with example on how to implement ajax full text search in laravel using full text search package. Please follow the instruction given below:

  • Step 1: Install Laravel New App
  • Step 2: Configuration .evn file
  • Step 3: Run Migration
  • Step 4: Install Full Text Search Package
  • Step 5: Add Fake Records in DB
  • Step 6: Add Routes,
  • Step 7: Create Controller
  • Step 8: Create Blade View
  • Step 9: Start Development Server

Step 1: Install Laravel Fresh Setup

In this tutorial, you will learn to integrate Razorpay payment gateway in your laravel 8 project. Follow this step by step tutorial to learn Razorpay payment gateway integration in laravel 8.

Step 2: Setup Database Credentials

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Step 3: Run Migration

Now, run following command to migrate database schema.

Step 4: Install Full Text Package

In this step, we will install Full Text Package via the composer dependency manager. Use the following command to install Full Text Package.

Step 5: Add Fake Records in DB

Now, we will generate some fake records using following command:

Then use the following command to create Model class for builder database query:

Then visit app/Models/Full_text_search.php And the following code into it:

Step 6: Create Routes

After this, we need to define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Step 7: Create Controller

Now, lets create a controller named FullTextSearchController using command given below –

Then go to app/Http/Controllers directory and open FullTextSearchController.php file. And put the following code into FullTextSearchController.php file:

Step 8: Create Blade View

In this step we will create blade view file. Go to resources/views/ directory and create one blade view file named full-text-search.blade.php file. Then put the following code into your full-text-search.blade.php file:

Step 9: Start Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Now, open the following URL in browser to see the output –

or

Laravel Jetstream Customize Login with Username or Email Tutorial

In this Laravel Jetstream Customize Login with Username or Email Tutorial I will show how to Customize Login with Username or Email in laravel. In this laravel 8 jetstream Customize Login with Username or Email tutorial I will show you to change login with email to username or login with username to email using jetstream auth in laravel application. Jetstream auth with livewire is laravel package that enable us to generate default laravel authentication scaffolding. Laravel jetstream auth includes fully functional login, register, logout, reset password, forget password, email verification, two-factor authentication, session management. Jetstream auth will include login, register, reset the password, forget password, email verification, and two-factor authentication blade views and controller file.

Laravel Jetstream Customize Login with Username or Email Tutorial

In this step by step tutorial I will guide through on how to Customize Login with Username or Email. You will learn to change login with email to username or login with username to email using jetstream auth in laravel application. Please follow the instruction given below:

  • Step 1 – Install Laravel 8 App
  • Step 2 – Database Configuration
  • Step 3 – Install Auth Scaffolding Jetstream
  • Step 4 – Install Livewire Package
  • Step 5 – Jetstream Configuration and Customization
  • Step 6 – Run PHP artisan Migrate
  • Step 7 – Install Npm Packages
  • Step 8 – Run Development Server

Step 1 – Install Laravel 8 App

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Step 2 – Database Configuration

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Step 3 – Install Auth Scaffolding Jetstream

In this step, we will install Jetstream Package via the composer dependency manager. Use the following command to install Jetstream.

Step 4 – Install Livewire Package

Now run following command to create basic authentication scaffolding login, register, logout and email verification views file:

Step 5 – Jetstream Configuration and Customization

Next, we will open fortify.php file and will enable and disable option of jetstream package as per requirement, which is located inside config directory.

And replace the following lines of code into fortify.php file:

After installing laravel jetstream successfully. Now, you need to do following changes on that FortifyServiceProvider.php, So visit app/Providers directory and open FortifyServiceProvider.php file then add the following code into it:


Then open login.blade.php file, which is placed resources/views/auth/ directory and add the following code into it:

Step 6 – Run php artisan Migrate

Now, run following command to migrate database schema.

Step 7 – Install Npm Packages

Now run following command to instal npm dependencies:

Then type the following command on cmd to run npm:

Step 8 – Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Now, open the following URL in browser to see the output –

Laravel 8 Add Captcha In Forms

n this Laravel 8 Add Captcha In Forms tutorial I’ll show you how to add or integrate captcha verification in laravel forms. In this tutorial you will learn to add captcha verification in laravel form. We will be using laravel captcha package to secure laravel forms against spamming. In this article we will be creating a simple form with some basic fields along with the captcha verification field.

What Is Captcha?

Captcha Verification is a common technique used in web forms to help to prevent spamming. Captcha helps to ensure that user is real humans and not a bot program to spam your forms. The user is somehow challenged to prove that they are human being.

Laravel 8 Add Captcha In Forms

In this step by step tutorial I will demonstrate you with example on how to add captcha verification field in laravel form. Please follow instruction given below:

  • Step 1 – Download Laravel 8 Application
  • Step 2 – Setup Database with App
  • Step 3 – Install Captcha Package
  • Step 4 – Register Captcha Package
  • Step 5 – Captcha Configuration
  • Step 6 – Create Form Routes
  • Step 7 – Create Form Controller By Artisan Command
  • Step 8 – Create Form Blade File
  • Step 9 – Run Development Server

Step 1 – Download Laravel 8 Application

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Step 2 – Setup Database with App

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Step 3 – Install Captcha Package

In this step, we will install laravel captcha Package via the composer dependency manager. Use the following command to install laravel captcha Package.

Step 4 – Register Captcha Package

In this step we will register captcha package in laravel application. So, Open providers/config/app.php file and register the captcha service provider and aliases.

Step 5 – Captcha Configuration

Now, open config/captcha.php file and enable or disable settings based on your requirement:

Step 6 – Create Routes

After this, we need to define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Step 7 – Create Form Controller By Artisan Command

Now, lets create a controller named CaptchaValidationController using command given below –

Now, go to app/http/controllers and open CaptchaValidationController.php file. And update the following code into it:

Step 8 – Create Blade File

Now, create blade view file to display form with captcha field and submit to database. Go to resources/views and create form-with-captcha.blade.php and update the following code into it:

The following below code will display validation error message on blade view file:

Step 9 – Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Now, open the following URL in browser to see the output –

Laravel Livewire Fullcalendar Integration Example

In this Laravel Livewire Fullcalendar Integration Example tutorial I’ll show you how to display events on the calendar using livewire fullcalendar components in laravel 8 application. In this tutorial you will learn to display events on the calendar using livewire fullcalendar in laravel 8. This tutorial you will also learn to show dynamic event data on calendar using livewire fullcalendar components in laravel.

Laravel Livewire Fullcalendar Integration Example

In this step by step tutorial I will demonstrate you how to display events on the calendar using livewire fullcalendar components in laravel 8 applications. Please follow the instruction given below:

  • Step 1: Install Laravel 8 App
  • Step 2: Add Database Detail
  • Step 3: Install Livewire Package
  • Step 4: Create FullCalendar Component using Artisan
  • Step 5: Add Route For Livewire FullCalendar
  • Step 6: Add Code On View File
  • Step 7: Run Development Server

Step 1: Install Laravel 8 App

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Step 2: Add Database Detail

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Create Model & Migration

Now, in this step we will create model and migration file. Please run the following command:

Then visit  /database/migrations directory and open event.php file and add the following code into it:


Now, run the migration to create database table using following artisan command:

Step 3: Install Livewire Package

In this step, we will install livewire Package via the composer dependency manager. Use the following command to install livewire Package.

Step 4: Create FullCalendar Component using Artisan

In this step we will create livewire calendar component using following command:

The above command will create the following components on the following path:

Now, go to app/Http/Livewire folder and open Calendar.php file. Then add the following code into your Calendar.php file:


Now, go to resources/views/livewire folder and open calendar.blade.php file. Then put the following code into your calendar.blade.php file:

Step 5: Add Route For Livewire Fullcalendar

After this, we need to define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Step 6: Add Code On View File

In this step we will create blade view file. Go to resources/views/ folder and open view files that name home.blade.php file. Then add the following code into your home.blade.php file:

Step 7: Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Now, open the following URL in browser to see the output –

Laravel Inertia JS Pagination Tutorial

In this Laravel Inertia JS Pagination Tutorial I will show you how to integrate Inertia js pagination in laravel 8 application. In this tutorial you will learn to integrate pagination using inertia js and Laravel Breeze from scratch. In this step by step guide on how to add pagination in laravel application using inertia js. In this example we will be using laravel breeze with inertia js to implement pagination in laravel application.

Laravel Inertia JS Pagination Tutorial

In this laravel inertia js pagination example I will demonstrate you how to implement pagination in laravel using inertia js. Please follow instruction given below:

  • Step 1: Download Laravel Fresh App
  • Step 2: Add Database Detail
  • Step 3: Install Laravel Breeze
  • Step 4: Add Routes
  • Step 5: Create Controller By Command
  • Step 6: Add Page and Component
  • Step 7: Run Development Server

Step 1: Download Laravel Fresh App

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Step 2: Add Database Details

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Step 3: Install Laravel Breeze

In this step, we will install Breeze Package via the composer dependency manager. Use the following command to install Breeze Package .

Now, run the migration to create database table using following artisan command:

Step 4: Add Routes

After this, we need to define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Step 5: Create Controller By Command

Now, lets create a controller named UserController using command given below –

Now, put the following code in app\Http\Controllers\UserController.php file.

Step 6: Add Page and Component

Next step, go to resources/assets/js/Pages/ folder and create a filed called Users.vue. And update the following code into your Users.vue components file:

Now open resources/assets/js/Components/ and open the /Pagination..vue component file and add the following code into it:

Step 7: Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –


Now, open the following URL in browser to see the output –

Laravel OneSignal Web Push Notification Example

In this Laravel OneSignal Web Push Notification Example tutorial, I’ll show you how to integrate and send web push notification using onesignal in laravel 8 application. In this tutorial you will learn integrate onesignal and send web push notification using onesignal in laravel project. In this article I will share example to integrate onesignal web push notification in laravel.

Laravel OneSignal Web Push Notification Example

In this step by step tutorial I will demonstrate you the process to integrate onesignal and to send web push notification in laravel. Please follow the instruction given below:

  • Step 1 – Install Laravel 8 App
  • Step 2 – Connecting App to Database
  • Step 3 – Install OneSignal Package
  • Step 4 – Configure OneSignal Package
  • Step 5 – Send Push Notification
  • Step 6 – Run Development Server

Before starting with this tutorial please visit the https://onesignal.com/ web site then create an account here and get secret id and key to send web push notifications from your laravel application.

Step 1 – Install Laravel 8 App

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Step 2 – Connecting App to Database

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

And as well as, configure a .env file with following keys:

Step 3 – Install OneSignal Package

In this step, we will install OneSignal Package via the composer dependency manager. Use the following command to install OneSignal Package.

Now, run the following command to publish config file,

Step 4 – Configure OneSignal Package

After Installing Image intervention package, we need to add service provider and alias in config/app.php file as following.

Add Provider
Add the provider to your config/app.php into provider section if using lower version of Laravel,

Add Facade
Add the Facade to your config/app.php into aliases section,

Step 5 – Send Push Notification

Now, below is example code to send web push notification using onesignal:

Step 6 – Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Laravel Ajax Multiple Delete Records using Checkbox Example

In this Laravel Ajax Multiple Delete Records using Checkbox Example tutorial I will show you how to select multiple records using checkbox and delete using ajax in laravel application. In this tutorial you will learn to select multiple records using checkbox and delete records using ajax in laravel application. In this article I will share example to select and delete multiple record from table using checkbox in laravel. We will be using jquery ajax to select and delete multiple records using checkbox in laravel.

Laravel Ajax Multiple Delete Records using Checkbox Example

In this step by step tutorial I will demonstrate you with example on how to select and delete multiple record from table using checkbox in laravel. Please follow the instruction given below:

  • Step 1 – Install Laravel 8 App
  • Step 2 – Connecting App to Database
  • Step 3 – Create Model and Migration
  • Step 4 – Add Routes
  • Step 5 – Create Controllers By Artisan
  • Step 6 – Create Blade Views
  • Step 7 – Run Development Server
  • Step 8 – Test This App

Step 1 – Install Laravel 8 App

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Step 2 – Connecting App to Database

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Step 3 – Create Modal and Migration

Now, in this step we will create model and migration file. Please run the following command:

Now, go to database/migrations/ and open create_categorys_table.php file. Then update the following code into this file:

Now, run the migration to create database table using following artisan command:

Next, open Category.php model file and update the following code into it, which is placed on app/Models/:

Step 4 – Add Routes

After this, we need to define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Step 5 – Create Controllers by Artisan

Now, lets create a controller named CategoryController using command given below –

The above command will create CategoryController. Now, go to app/http/controller and open CategoryController.php.Then put the following methods into your controller file:

Step 6 – Create Blade Views

In this step we will create blade views file for rendering data on it. So go  to resources/views folder and create the blade view as following. Create first file name index.blade.php and update the following code into it:

Step 7 – Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Now, open the following URL in browser to see the output –

Laravel 8 Add Share Social Media Button Example

In this Laravel 8 Add Share Social Media Button Example tutorial I will show you how to add social media share button in your laravel application. In this tutorial you will learn to add social media share buttons in your laravel project. In this article I will share example to add social media share button in your laravel application.

Laravel 8 Add Share Social Media Button Example

In this step by step tutorial I will demonstrate you with example how to add social media share buttons in laravel application. Please follow instruction given below:

  • Step 1 – Install Laravel 8 App
  • Step 2 – Connecting App to Database
  • Step 3 – Install Social Media Button Package
  • Step 4 – Add Route
  • Step 5 – Generate Controller by Command
  • Step 6 – Create Blade View
  • Step 7 – Run Development Server
  • Step 8 – Test This App

Step 1 – Install Laravel 8 App

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Step 2 – Connecting App to Database

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Step 3 – Install Social Media Button Package

In this step, we will install Social Media Button Package via the composer dependency manager. Use the following command to install Social Media Button Package.

After Installing Image intervention package, we need to add service provider and alias in config/app.php file as following.

config/app.php

Now run the following command to publish config file:

Step 4 – Add Route

After this, we need to define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Step 5 – Generate Controller by Command

Now, lets create a controller named ShareSocialController using command given below –

Once the above command executed, it will create a controller file ShareSocialController.php in app/Http/Controllers/ directory. Open the ShareSocialController.php file and put the following code in it.

app/Http/Controllers/ShareSocialController.php

Step 6 – Create Blade View

In this step we will create blade view files. Go to  /resources/views/ directory and create a new blade view file, which name share-social.blade.php. And put the following code into it:

Step 7 – Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Now, open the following URL in browser to see the output –

Laravel Bootstrap 4 Multiselect Dropdown with Checkbox

In this Laravel Bootstrap 4 Multiselect Dropdown with Checkbox tutorial I will show you how to create bootstrap 4 Multiselect Dropdown with Checkbox in laravel application. In this tutorial you will learn to integrate bootstrap multiselect dropdown in laravel application. In this article I will share example to select multiple dropdown options using checkbox in laravel. We will be using bootstrap 4 multiselect dropdown with checkbox. Then user will be able to select multiple dropdown options using checkbox.

Laravel Bootstrap 4 Multiselect Dropdown with Checkbox

In this step by step tutorial I will demonstrate you how to create bootstrap 4 Multiselect Dropdown with Checkbox in laravel application. Please follow instruction given below:

  • Step 1 – Install Laravel 8 App
  • Step 2 – Connecting App to Database
  • Step 3 – Create Model and Migration
  • Step 4 – Add Routes
  • Step 5 – Create Controllers By Artisan
  • Step 6 – Create Blade Views
  • Step 7 – Run Development Server
  • Step 8 – Test This App

Step 1 – Install Laravel 8 App

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Step 2 – Connecting App to Database

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Step 3 – Create Modal and Migration

Now, in this step we will create model and migration file. Please run the following command:

Now, go to database/migrations/ and open create_categorys_table.php file. Then update the following code into this file:


Now, run the migration to create database table using following artisan command:

Now, open Category.php model file and update the following code into it:

Step 4 – Add Routes

After this, we need to define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Step 5 – Create Controllers by Artisan

Now, lets create a controller named CategoryController using command given below –

The above command will create CategoryController. Now, go to app/http/controller and open CategoryController.php.Then update the following methods into your controller file:

Step 6 – Create Blade Views

In this step we will create blade view files. Go to resources/views folder and create the blade view as following. Create a file name index.blade.php and update the following code into it:

Step 7 – Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Now, open the following URL in browser to see the output –

Laravel 8 Automatic Daily Database Backup Example

In this Laravel 8 Automatic Daily Database Backup Example tutorial, I’ll show you how to take daily automatic database backup in laravel. In this tutorial you will learn to take Daily Automatic Database Backup in laravel. In this article I will guide you through process how to take daily automatic database backup of your laravel application.

Laravel 8 Automatic Daily Database Backup Example

In this step by step tutorial I’ll guide you through the process to take daily automatic database backup in laravel. Pleasae Follow the instruction given below and take daily automatic database backup in laravel apps using schedular cron job:

  • Step 1: Create Command
  • Step 2: Register Command In “Kernel.php”
  • Step 3: Edit the “ DbBackup.php”
  • Step 4: Backup Files

Step 1: Create Command

In this step we will switch to project directory as following:

Then use the below command to create command:

This command creates one file named DbBackup.php.

Step 2: Register Command In “Kernel.php”

Now go to app/console and open kernal.php file. And then update the following code into your file:

Step 3: Edit the “ DbBackup.php”

Now, go to app/Console/Commands/ folder and open DbBackup.php. And then update the following code into your

Step 4: Backup Files

Finally the above Laravel scheduler command will take backup of database in zipped format and place file at “storage/app/backup”. So you can go to storage/app/backup folder and find daily database backup files here.

Laravel Eloquent selectRaw Query Tutorial

In this Laravel Eloquent selectRaw Query Tutorial I will show you how to use selectRaw method to create select raw queries in laravel application. In this tutorial you will learn to create raw queries using eloquent selectRaw method in laravel application. In this article I will share various example to use selectRaw method to create select raw queries in laravel. We will also create select raw query with multiple conditions.

Laravel Eloquent selectRaw Query Tutorial

In this step by step tutorial I will demonstrate various examples on how to use selectRaw() eloquent query in laravel:

  • Laravel selectRaw Query using Model
  • selectRaw Query using Query Builder
  • Laravel selectRaw with joined table data

Example 1: Laravel selectRaw Query using Model

In this example we will be using selectRaw method using model:

When you dump the above given selectRaw query you will get the following SQL query:

Example 2: selectRaw Query using Query Builder

In this example we will be using selectRaw method with query builder:


When you dump the above given selectRaw query you will get the following SQL query:

Example 3: Laravel selectRaw with joined table data

In this example we will be using selectRaw with joins: