Category Archives: Laravel

Laravel Tutorials

Laravel 7 Load More Data On Infinite Page Scroll

In this Laravel 7 Load More Tutorial From Scratch tutorial I’ll show you how to implement infinity scroll or dynamix ajax load more on page scroll in laravel. In this tutorial you will learn to implement dynamic load more pagination in laravel. In this step by step guide I’ll share example of ajax load more or infinity scroll in laravel.

Laravel 7 Load More Data On Infinite Page Scroll

  • Download Laravel Fresh Setup
  • Configure .env file
  • Create One Model and Migration
  • Create Route
  • Generate Controller by Command
  • Create Blade View
  • Run Development Server

Step 1: Download Laravel Fresh Setup

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

Step 2: Configure .env file

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 Model and Migration

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

Now, go to app/database/migrations and open posts migration file and put following fields

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

Step 4: Create 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 PostController using command given below –

Now, go to app/http/controller/PostController and open PostController. And put the following code into your PostController file:

Step 6: Create a blade view

Now, we will create a blade file name posts.blade.php. And update the below HTML code into your posts.blade.php file:

This blade view file displays your all blog posts when you scroll the page down. Now, update the following script into your blade view 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 7 Livewire Crud Example

In this Laravel livewire crud example tutorial I will shoe you how to create simple crud  application using livewire package in laravel. In this tutorial you will learn to create basic CRUD application using livewire package in laravel. In this article you will also learn how to validate laravel livewire forms, how to update livewire form data, and how to edit livewire form data in laravel.

Laravel 7 Livewire Crud Example

  • Step 1: Download Laravel Fresh App
  • Step 2: Setup Database Configuration
  • Step 3: Install Livewire
  • Step 4: Create Component
  • Step 5: Add Route
  • Step 6: Create Blade Views
  • 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 using the below command

Step 2: Setup 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 Livewire

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

Step 4: Create Component

In this step we will create a component using following command:

The above command will create two files on the following location:

app/Http/Livewire/Users.php

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 Blade Views

In this step we will create following blade views file and update the following code into your files:

resources/views/livewire/users.blade.php

resources/views/livewire/home.blade.php

resources/views/livewire/create.blade.php

resources/views/livewire/update.blade.php

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 7 jwt Authentication Rest API Tutorial

In this Laravel 7 jwt Authentication Rest API Tutorial I’ll show you how to build the rest APIs with jwt (JSON web token) authentication in laravel 7. In this example I’ll also show you how to install jwt auth and configure jwt auth in laravel 7. In this article, we will learn to create fully functional restful API with JWT Authentication in Laravel 7. In this tutorial, we will be creating fully functional REST API along with JWT Authentication.

Laravel 7 jwt Authentication Rest API Tutorial

  • Step 1: Install Laravel 7/6/5 App
  • Step 2: Configure Database
  • Step 3: Install jwt laravel
  • Step 4: Configure jwt in laravel
  • Step 5: Generate jwt secret key
  • Step 6: Add jwt Class in Model
  • Step 7: Add Api Routes
  • Step 8: Create Api Controller
  • Step 9: Run Development Server

Step 1: Install Laravel 7/6/5 App

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

Step 2: Configure 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 jwt laravel

In this step, we will install tymon jwt auth package via the composer dependency manager. Use the following command to install laravel jwt authentication package.

Step 4: Configure jwt in laravel

After Installing tymon/jwt-auth package, we need to add service provider and alias in config/app.php file as following.

config/app.php

After that, run the below given command to publish the configuration file in Laravel for jwt auth:

Step 5: Generate jwt secret key

Now, you need to generate jwt encryption keys. Use the following command to generate encryption keys needed to generate secure access tokens:

Now, open JWTGenerateCommand.php file and put the following code,

vendor/tymon/src/Commands/JWTGenerateCommand.php

Step 6: Add jwt Class in Model

In this step, Navigate to App folder and open User.php file. Then update the following code into User.php:

Step 7: Add Api Routes

Now, go to routes folder and open api.php. Then put the following routes into api.php file:

Step 8: Create Api Controller

After that, you need to create some methods in JwtAuthController.php. So go to app/http/controllers/ and open JwtAuthController.php file. Then put the following methods into your JwtAuthController.php file:

Step 9: Run Development Server

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

Laravel Ajax Image Crop and Upload using jQuery

In this Laravel Ajax Image Crop and Upload using jQuery tutorial I’ll show you how to upload in crop image using jquery ajax in laravel. In this tutorial you will learn to upload in crop image before upload using jquery ajax in laravel. In this step by step guide I will demonstrate you to upload and crop image in laravel using jquery ajax.

Laravel Ajax Image Crop and Upload using jQuery

  • Step 1: Download Laravel App
  • Step 2: Add Database Details
  • Step 3: Create Crop Image Migration & Model
  • Step 4: Add Routes For Crop Image Upload
  • Step 5: Create Crop Image Controller File Using Command
  • Step 6: Create Crop Image Upload Blade View
  • Step 7: Make Upload Folder
  • Step 8: Run Development Server

Step 1: Download Laravel App

First of all we need to create a fresh laravel project, download and install Laravel 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: Create Crop Image Migration & Model

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

Now, go to database/migrations folder and open create_images_table.php. Then put the following code into create_images_table.php:

Now run the following command to migrate the table into your select database:

Step 4: Add Routes For Crop Image Upload

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 Crop Image Controller File Using Command

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

Now go to app/http/controllers/ folder and open CropImageUploadController.php. Then put the following file uploading methods into your CropImageUploadController.php file:

Step 6: Create Crop Image Upload Blade View

In this step, create a blade view file named image-crop.blade.php. Go to  /resources/views and create one file name image-crop.blade.php. Then put the following code into your image-crop.blade.php file:

Step 7: Make Upload Folder

Now, create one folder name upload inside public directory.

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 –

Multiple File Upload With Progress Bar in Laravel

In this Multiple File Upload With Progress Bar in Laravel tutorial I’ll show you how to upload multiple file with progress bar in laravel. In this tutorial you will learn to upload multiple file with a progress bar in laravel using ajax. In this example we will display progress bar while uploading multiple image file in laravel. In this step by step guide I’ll demonstrate you how to upload multiple file with progress bar using ajax in laravel.

Multiple File Upload With Progress Bar in Laravel

  • Step 1: Download Laravel App
  • Step 2: Add Database Details
  • Step 3: Create Migration & Model
  • Step 4: Add Multiple File Upload Routes
  • Step 5: Create Multiple File UploadController by Artisan
  • Step 6: Create Multiple File Upload with Progress Bar Blade View
  • Step 7: Run Development Server

Step 1: Download Laravel App

First of all we need to create a fresh laravel project, download and install Laravel 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: Create Migration & Model

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

The above command will create a model name Gallery.php and a migration file for the Gallery table. Then go to database/migrations folder and open create_galleries_table.php. Then put the following code into create_galleries_table.php:

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

Step 4: Add Multiple File Upload 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: Create Multiple File Upload Controller by Artisan

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

The above command will create a controller named MultipleFileUploadController.php file. Now, go to app/http/controllers/ folder and open MultipleFileUploadController.php. Then put the following file uploading methods into your MultipleFileUploadController.php file:

Step 6: Create Multiple File Upload with Progress Bar Blade View

In this step, we will create a blade file named multiple-file-upload-progress-bar.blade.php. Now, go to /resources/views and create a file name multiple-file-upload-progress-bar.blade.php. Then put the following code into your multiple-file-upload-progress-bar.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 7 Firebase CRUD Example Tutorial

In this Laravel 7 Firebase CRUD Example Tutorial I’ll show you how to create realtime crud operation example using google firebase in laravel project. In this tutorial you will learn to create real time crud application using firebase in laravel. In this article I will share example of using firebase to create crud application in laravel. Firebase make is easy to perform real time operation for crud application. In this step by step guide we will be creating a simple real time CRUD example using firebase database in laravel.

Laravel 7 Firebase CRUD Example Tutorial

  • Step 1: Create Firebase Project
  • Step 2: Intsall Laravel Application
  • Step 3: Add Route
  • Step 4: Add Firebase Settings in Service.php
  • Step 5: Create Controller Using Artisan
  • Step 6: Create View Files
  • Step 7: Run Development Server

Step 1: Create Firebase Project

First of all, you need to create google firebase project. Follow the instructions given below to create google firebase project.

  • Go to https://firebase.google.com/ and create a google firebase project, as follows:
  • Fill your google firebase project name and click the “continue button.
  • Click “Continue” button
  • Click “Create Project” Button. And your google firebase project will successfully be created.

Then, You will see blogs on top menu, click it. And create web app with a blogs name or you want to keep name accordingly. Then copy google firebase configuration and database details.

Step 2: Install Laravel App

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

Step 3: 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 4: Add Firebase Settings in Service.php

Now, go to the config folder and open services.php file. Then put the following google firebase configuration details into services.php file:

Step 5: Create Controller By Artisan

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

Then app/http/controller folder and open UserController.php file. And put the following code into your UserController.php file:

Step 6: Create Blade View File

In this step, go to resources/view folder and create a blade file named users.blade.php. Then put the following code into your users.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 Livewire Pagination Example Tutorial

In this Laravel Livewire Pagination Example tutorial I’ll show you how to implement pagination in laravel application using laravel livewire pagination component. In this tutorial you will learn to create pagination using laravel livewire pagination.We will be using default laravel pagination method to create pagination using livewire in laravel. In this step by step tutorial I will demonstrate to implement laravel livewire pagination app.

Laravel Livewire Pagination Example Tutorial

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

Step 1: Install Laravel App

First of all we need to create a fresh laravel project, download and install Laravel 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.

Step 3: Run Migration

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

The above command will create a model name Employee.php,create a migration name create_employees_table.php and one faker file that name EmployeeFactory.php . Now, go to database/migrations folder and open create_ employees_table.php file. Then put the following code into create_ employees_table.php file

Now, go to app\Providers folder and open AppServiceProvider.php file. And put the following code into AppServiceProvider.php file:

Next, open your command prompt and run the following command to create the table into your database:

Next, go to app/Employee.php and update the following code into your Employee.php model as follow:

Next, go to database/factories and open EmployeeFactory.php. Then update the following code into it as follow:

After that, run the following command to generate fake data using faker as follow:

Step 4: 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 5: Create Component using Artisan

In this step we will create a component using following command:

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

After that, go to resources/views/livewire folder and open search-pagination.blade.php file. Then put the following code into your search-pagination.blade.php file:

Step 6: 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 7: Create View File

In this step, go to resources/views/livewire folder and create a blade file that name home.blade.php file. Then put the following code into your home.blade.php file:

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 Livewire Image Upload From Scratch

In this Laravel Livewire Image Upload Example tutorial I’ll show you how to upload image file livewire package in laravel project. In this tutorial you will learn to upload image file livewire package in laravel. Laravel livewire package makes uploading and saving image files easy. With Laravel livewire package it is easy handle file upload.

Laravel Livewire Image Upload From Scratch

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

Step 1: Install Laravel App

First of all we need to create a fresh laravel project, download and install Laravel 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.

Step 3: Create Model & Migration using Artisan

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

The above command will create a model name Image.php and also create a migration that name create_images_table.php. Now go to database/migrations folder and open create_images_table.php file. Then put the following code into create_images_table.php file

Then go to app\Providers folder and open AppServiceProvider.php file. And put the following code into AppServiceProvider.php file:

Now run the following command to create the table into your database:

Now, Open App/Image.php file and put the fillable properties:

Step 4: 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 5: Create Component using Artisan

In this step we will create a 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 UploadImage.php file. Then add the following code into your UploadImage.php file:

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

Step 6: 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 7: Create View File

In this step, go to resources/views/livewire folder and create a blade files name home.blade.php file. Then put the following code into your home.blade.php file:

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 Livewire File Upload From Scratch

In this Laravel Livewire file Upload Example tutorial I’ll show you how to upload file with livewire package in laravel project. In this tutorial you will learn to upload file using livewire package in laravel. Laravel livewire package makes uploading and saving image files easy. With Laravel livewire package it is easy handle file upload.

Laravel Livewire File Upload From Scratch

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

Step 1: Install Laravel App

First of all we need to create a fresh laravel project, download and install Laravel 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.

Step 3: Create Model & Migration For File using Artisan

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

The above command will create a model name Document.php and also create a migration that name create_documents_table.php. Now, go to database/migrations folder and open create_documents_table.php file. Then put the following code into create_documents_table.php file:

Now, go to app\Providers folder and open AppServiceProvider.php file. And put the following code into AppServiceProvider.php file:

Now run the following command to create the table into your database:

Now, Open App/Document.php file and add the fillable properties:

Step 4: 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 5: Create File Upload Component using Artisan

In this step we will create a 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 LaraFileUpload.php file. Then put the following code into your LaraFileUpload.php file:

After that, go to resources/views/livewire folder and open lara-file-upload.blade.php file. Then put the following code into your lara-file-upload.blade.php file:

Step 6: Add Route For Livewire File Upload

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 View File

In this step, go to resources/views/livewire folder and create one blade view files that name home.blade.php file. Then add the following code into your home.blade.php file:

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 Livewire Multiple Image Upload Example

In this Laravel Livewire Multiple Image Upload Example tutorial I’ll show you how to upload multiple image file livewire package in laravel project. In this tutorial you will learn to upload multiple image file livewire package in laravel. Laravel livewire package makes uploading and saving multiple image files easy. With Laravel livewire package it is easy handle multiple file upload. It automatically detects multiple attributes on the <input> tag.

Laravel Livewire Multiple Image Upload Example

  • Step 1: Install Laravel
  • Step 2: Add Database Detail
  • Step 3: Generate Migration and Model by Command
  • Step 4: Install Livewire
  • Step 5: Create Component
  • Step 6: Create Route
  • Step 7: Create View File
  • Step 8: Run Development Server

Step 1: Install Laravel App

First of all we need to create a fresh laravel project, download and install Laravel 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.

Step 3: Generate Model and Migration By Command

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

The above command will create a model name Image.php and also create a migration name create_images_table.php. Now, go to database/migrations folder and open create_images_table.php file. Then put the following code into create_images_table.php file:

Then go to app\Providers folder and open AppServiceProvider.php file. And put the following code into AppServiceProvider.php file:

Now run the following command to create the table into your added database:

Now, Open App/Image.php file and add the fillable properties:

Step 4: Install Livewire

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

Step 5: Create Component

In this step we will create a 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 UploadMultipleImage.php file. Then add the following code into your UploadMultipleImage.php file:

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

Step 6: Create 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 7: Create View File

In this step, go to resources/views/livewire folder and create a view files that name home.blade.php file. Then put the following code into your home.blade.php file:

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 Livewire Add or Remove Dynamically Input Fields

In this Laravel Livewire Add or Remove Dynamically Input Fields tutorial I’ll show you how to add or remove multiple input fields dynamically using livewire in laravel. In this tutorial you will learn to create add or remove multiple input fields dynamically using livewire in laravel.

Laravel Livewire Add or Remove Dynamically Input Fields

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

Step 1: Install Laravel App

First of all we need to create a fresh laravel project, download and install Laravel 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.

Step 3: Run Migration

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

The above command will create a model name Employee.php, and create a migration  name create_employees_table.php. Now, go to database/migrations folder and open create_ employees_table.php file. Then put the following code into create_ employees_table.php file:

Now, you navigate to app\Providers folder and open AppServiceProvider.php file. And update the following code into AppServiceProvider.php file:

Next, open your command prompt and run the following command to create the table into your database:

Next, Navigate to app/Employee.php and update the following code into your Employee.php model as follow:

Step 4: 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 5: Create Component using Artisan

In this step we will create a component using following artisan command:

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

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

After that, Navigate to resources/views/livewire folder and open employees.blade.php file. Then add the following code into your employees.blade.php file:

Step 6: 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 7: Create View File

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

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 7 Google Bar Chart Example From Scratch

In this Laravel Google Bar Chart Example Tutorial I’ll will show how to use google Bar chart in laravel application. In this tutorial you will learn to implement google Bar char in laravel project. With Google Charts we can visualize data in your laravel web application. In this tutorialI’ll share example to demonstrate use of google Bar chart in laravel.

Laravel 7 Google Bar Chart Example From Scratch

  • Step 1: Install Laravel App
  • Step 2: Add Database Details
  • Step 3: Generate Migration & Model File
  • Step 4: Add Route
  • Step 5: Create Controller
  • Step 6: Create Blade File
  • Step 7: Run Development Server

Step 1: Install Laravel App

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

Step 2: Add 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: Generate Migration & Model File

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

Then go to app directory and open Order.php file. And put the following code into your Order.php file:

After that go to database/migrations/ and open create_orders_table.php file and update the following code:

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

After that, go to database/factories folder and open OrderFactory.php file. And the following code into your OrderFactory.php file:

Now run the following command to generate fake data into your database in laravel:

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: Create Controller

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

Then go to app/http/controller folder and open OrderController.php. And put the following code into your OrderController.php file:

Step 6: Create Blade File

In this step, we will go to /resources/views/ folder and create a blade view file name google-bar-chart.blade.php. And put the following code into your google-bar-chart.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 –