Category Archives: Laravel

Laravel Tutorials

Laravel Dynamic Google Pie Charts Example From Scratch

In this Laravel Google Pie Chart Example Tutorial I’ll will show how to use google Pie chart in laravel application. In this tutorial you will learn to implement google Pie chart 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 Pie chart in laravel.

Laravel Dynamic Google Pie Charts Example From Scratch

  • Step 1: Install Laravel App
  • Step 2: Add Database Details
  • Step 3: Add Route
  • Step 4: Create Controller
  • Step 5: Create Blade File
  • Step 6: Add Google Chart Library
  • 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 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: 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: Create Controller

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

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

Step 5: Create Blade File

In this step, go to /resources/views/ folder and create a blade file name google-pie-chart.blade.php. And put the following code into your google-pie-chart.blade.php file:

Step 6: Add Google Chart Library

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

In this Laravel Google Line Chart Example Tutorial I’ll will show how to use google line  chart in laravel application. In this tutorial you will learn to implement google line 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 line graph chart in laravel.

Laravel Google Line Chart Example Tutorial From Scratch

  • Step 1: Install Laravel App
  • Step 2: Add Database Details
  • Step 3: Add Route
  • Step 4: Create Controller
  • Step 5: Create Blade File
  • Step 6: 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: 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: Create Controller

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

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

Step 5: Create Blade File

In this step, we will go to /resources/views/ folder and create a blade file name google-line-chart.blade.php. And put the following code into your google-line-chart.blade.php file:

Step 6: 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 Ajax File Upload with Progress Bar

In this Laravel 7 file upload with progress bar tutorial I’ll show how to implement Ajax File Upload with progress bar in laravel. In this tutorial you will learn to implement progress bar along with ajax file upload. In this step by step tutorial I’ll share example to demonstrate the ajax image uploading with progress bar.

Laravel 7 Ajax File Upload with Progress Bar

  • Step 1: Install Laravel App For Progress Bar
  • Step 2: Add Database Details
  • Step 3: Create Migration & Model
  • Step 4: Add Routes
  • Step 5: Create Controller by Artisan
  • Step 6: Create Blade View
  • Step 7: Run Development Server
  • Step 8: Live Demo

Step 1: Install Laravel App For Progress Bar

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:

This command will create one model name Doc.php and as well as one migration file for the Docs table.Now, go to database/migrations folder and open create_docs_table.php. Then update the following code into create_docs_table.php:

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

Step 4: Create Route For File

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 Artisan

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

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

Step 6: Create Blade View

In this step, create one blade view file named progress-bar-file-upload.blade.php. Go to /resources/views and create one file name progress-bar-file-upload.blade.php. Then put the following code into your progress-bar-file-upload.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 Crop Image Before Upload in Controller

In this laravel crop image before upload tutorial, I’ll show you how to crop image before upload in laravel. In this tutorial you will learn to crop image before upload in laravel using using jquery copper js. In this article I’ll demonstrate to crop and upload image in laravel using jquery copper js. In this example will store cropped image in the folder and later save it into database.

In this step by step guide we will be using cropper js to crop the image before uploading using bootstrap model. In this example We will be using crop the image will be in bootstrap model. Then we will also use the bootstrap model in which the preview of the image will also be shown.

Laravel 7 Crop Image Before Upload in Controller

  • Step 1: Install New Laravel App
  • Step 2: Add Database Details
  • Step 3: Create Migration & Model
  • Step 4: Add Route
  • Step 5: Create Controller By Artisan
  • Step 6: Create Blade View
  • Step 7: Make Upload Directory
  • Step 8: Start Development Server

Step 1: Install New 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: Migration & Model

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

This command will create one model name Picture and also create one migration file for the Pictures table. Now, Navigate to database/migrations folder and open create_pictures_table.php file. And add the following code into it:

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 Artisan

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

Then, Navigate to app/http/controllers folder and open CropImageController.php file. Then put the following code into your laravel CropImageController.php file:

Step 6: Create Blade view

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

Note that, you need to include the below following javascript cropper js library into your crop-image-upload.blade.php file:


Then, include the following script code into your crop-image-upload.blade.php file:


Here, the full source code of crop-image-upload.blade.php file with all javascript libraries, script code and css code:

Step 7: Make Upload Directory

In this step, navigate to your laravel project root directory and open public directory. Inside public directory, create one new directory name upload.

Step 8: 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 –

Laravel Signature Pad Tutorial From Scratch

In this Laravel digital signature pad tutorial I’ll show you how to implement a digital signature pad in laravel. In this tutorial you will learn to implement a digital signature pad in laravel application. In this step by step guide I will demonstrate you how to implement a digital signature pad in laravel.

We will be using Laravel kenth-wood jquery UI signature pad library to implement digital signature pad in laravel application.

Laravel Signature Pad Tutorial From Scratch

  • Step 1: Install Laravel New App
  • Step 2: Connect Database To App
  • Step 3: Create One Model and Migration
  • Step 4: Add Routes For digital Signature Pad
  • Step 5: Create Controller by Artisan Command
  • Step 6: Create Blade View
  • Step 7: Make Upload Directory
  • Step 8: Start Development Server

Step 1: Install Laravel New App

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

Step 2: Connect Database To 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: Create Model and Migration

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

Now, go to database/migrations directory and open create_signatures_table.php file in text editor. Then put the following code in your create_signatures_table.php file inside public directory.

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

Step 4: Add Routes For digital Signature Pad

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 Artisan Command

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

Then, Navigate to app/http/controllers directory and open SignatureController.php file. And put following code into SignatureController.php file:

Step 6: Create a blade view

Now, we will create one blade view file that name signature-pad.blade.php file for digital signature pad. Then put the following code into your signature-pad.blade.php file:

Step 7: Make Upload Directory

In this step, navigate to your laravel project root directory and open public directory. Inside public directory, create one new directory name upload.

Step 8: 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 –

Laravel 7 Full Text Search Tutorial

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

Laravel 7 Full Text Search Tutorial

  • 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

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

Step 2: Configuration .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: Run Migration

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

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:

After running the php artisan tinker. Run the following command. It will add 150 fake records in your database:

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 –

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

Step 8: Create Blade View

In this step, we will go to resources/views/ directory and create one blade view file named full-text-search.blade.php file. Then add 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 7 Livewire Load More Tutorial From Scratch

In this Laravel 7 Livewire 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 using livewire. In this tutorial you will learn to implement dynamic load more pagination in laravel using livewire package. In this step by step guide I’ll share example of ajax load more or infinity scroll in laravel using livewire package.

Laravel 7 Livewire Load More Tutorial From Scratch

  • Step 1: Download Laravel App
  • Step 2: Add Database Detail
  • Step 3: Create Model & Migration using Artisan
  • Step 4: Install Livewire Package
  • Step 5: Create Load More Component using Artisan
  • Step 6: Add Route
  • Step 7: Create Blade 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

In this step we will run the migration to create database table using following artisan command:

This command will create table into your database.

Now, run the following command to generate fake data using laravel faker as follow:

then

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 Load More Component using Artisan

Now, we will create a load more component using following artisan command:

This command will create the following components on the following path:

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

Now, go to resources/views/livewire folder and open users.blade.php file. Then add the following code into your users.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

Now go to resources/views/livewire folder and create one blade view files lists.blade.php file. Then put the following code in lists.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 –

Country State City Dropdown using Ajax in Laravel

In this Laravel country state city dependent dropdown tutorial I’ll show you how to implement dependent country state city dropdown in laravel using jQuery ajax. In this tutorial you will learn to create country state city dropdown using jquery ajax in laravel. In this step by step tutorial I will demonstrate creating ajax country state city dropdown with example.

Country State City Dropdown using Ajax in Laravel

  • Step 1: Install Laravel App
  • Step 2: Add Database Details
  • Step 3: Create Country State City Migration and Model File
  • Step 4: Add Routes For Country State City
  • Step 5: Create Controller For Fetch Country State City
  • Step 6: Create Blade File For Show Dependent Country State City in Dropdown
  • 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 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 Country State City Migration and Model File

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

Next, Navigate to database/migrations directory and open create_country_state_city_tables.php. Then update the following code into create_country_state_city_tables.php file, as follow:

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 to Fetch Country State City

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

Then, Navigate to app/http/controllers and open CountryStateCityController.php file. And update the following code into your CountryStateCityController.php file, as follow:

Step 6: Create Blade File For Dependent Country State City Dropdown

Now, go to resources/views directory And create 1 blade views that named country-state-city.blade.php the file inside this directory.

Then open country-state-city.blade.php file and update the following code into create.blade.php file, as follow:

Now add country state city script code into your country-state-city.blade.php file, after the closing of body tag:

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 Add/Remove Multiple Input Fields using jQuery

In this Laravel Dynamically Add or Remove multiple Input Fields jQuery tutorial I’ll show you how to dynamically add or remove multiple input field in form using jQuery in laravel. In this tutorial you will learn to dynamically add or remove multiple input field in form using jquery in laravel. In this tutorial I’ll share example to demonstrate Dynamically Add or Remove multiple Input Fields jQuery.

Laravel Add/Remove Multiple Input Fields using jQuery

  • Step 1: Install Laravel App
  • Step 2: Add Database Details
  • Step 3: Create Migration & Model
  • Step 4: Add Routes
  • Step 5: Create Controller by Artisan
  • Step 6: Create Blade View
  • 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 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 one model name Todo.php and as well as one migration file for the Todos table.

Now go to database/migrations folder and open create_todos_table.php. Then update the following code into create_todos_table.php:

Then navigate to app/Todo.php file. And the fielable property like following:

Now, run the migration to create database table using following artisan 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 Artisan

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

Next, Navigate to app/http/controllers/ folder and open DynamicAddRemoveFieldController.php. Then add the following file uploading methods into your DynamicAddRemoveFieldController.php file:

Step 6: Create Blade View

Now, go to resources/views and create one file name add-remove-multiple-input-fields.blade.php Then update the following code into your add-remove-multiple-input-fields.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 Dynamically Add or Remove Input Fields jQuery

In this Laravel Dynamically Add or Remove Input Fields jQuery tutorial I’ll show you how to dynamically add or remove input field in form using jQuery in laravel. In this tutorial you will learn to dynamically add or remove input field in form using jquery in laravel. In this tutorial I’ll share example to demonstrate Dynamically Add or Remove Input Fields jQuery.

Laravel Dynamically Add or Remove Input Fields jQuery

  • Step 1: Install Laravel App
  • Step 2: Add Database Details
  • Step 3: Create Migration & Model
  • Step 4: Add Routes
  • Step 5: Create Controller by Artisan
  • Step 6: Create Blade View
  • 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 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 one model name Todo.php and as well as one migration file for the Todos table.

Now go to database/migrations folder and open create_todos_table.php. Then update the following code into create_todos_table.php:

Now, run the migration to create database table using following artisan 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 Artisan

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

This command will create a controller named AddRemoveFieldController.php file.

Next, Navigate to app/http/controllers/ folder and open AddRemoveFieldController.php. Then add the following file uploading methods into your AddRemoveFieldController.php file:

Step 6: Create Blade View

In this step, we will create one blade view file named add-remove-input-fields.blade.php.

Now, go to resources/views and create one file name add-remove-input-fields.blade.php Then update the following code into your add-remove-input-fields.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 –

Livewire Login Register in Laravel

In this Laravel livewire registration and login example I’ll will show you how to create basic registration and login using livewire in laravel. In this tutorial you will learn to create basic login and registration functionality using livewire in laravel. In this step by step tutorial I’ll share basic authentication example of create livewire login and registration in laravel.

Livewire Login Register in Laravel

  • Step 1: Download Laravel App
  • Step 2: Add Database Detail
  • Step 3: Run Migration Command
  • Step 4: Install Livewire to Create Components
  • Step 5: Generate Livewire Components for Login & Registration
  • Step 6: Add Routes
  • Step 7: Create View File
  • 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 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 Command

Now, run following command to migrate database schema.

Step 4: Install Livewire to Create Components

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

Step 5: Generate Livewire Components for Login & Registration

Now, create the livewire components for creating a laravel livewire registration and login components using the following command. So Open your cmd and run the following command:

This command will create the following components on the following path:

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

After that, Navigate to resources/views/livewire folder and open registration-login.blade.php file. Then add the following code into your registration-login.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, navigate 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 7 Vue Js Multiple Image Upload Using Dropzone Example

In this Laravel 7 Vue Js Multiple Image Upload Using Dropzone Example tutorial, I will show you how to upload multiple image file using dropzone drag and drop. In this tutorial you will learn to implement drag and drop image upload using dropzone package with Vue Js in laravel. In this tutorial we learn to :-

  • Uploading multiple images with dropzone
  • Saving images with unique file names to database

Laravel 7 Vue Js Multiple Image Upload Using Dropzone Example

  • Step 1: Download Laravel Fresh App
  • Step 2: NPM Module Configuration For Vue Js
  • Step 3: Add Routes
  • Step 4: Create Controller By Command
  • Step 5: Create ImageUplaod Vue Component
  • Step 6: Create Blade Views And Initialize Vue Components
  • 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: NPM Module Configuration For Vue Js

Install all Vue dependencies:


After that, install vue dropzone dependencies by using the below command:

Step 3: 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 4: Create Controller By Command

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

After that, go to app\Http\Controllers and open ImageController.php file. Then update the following code into your ImageController.php file:

Step 5: Create ImageUplaod Vue Component

Now, go to resources/assets/js/components folder and create a file called MultipleImageUploadComponent.vue.

Now, put the following code into your MultipleImageUploadComponent.vue components file:

Now open resources/assets/js/app.js and include the MultipleImageUploadComponent.vue component as follow

Step 6: Create Blade Views And Initialize Vue Components

Next, Navigate to resources/views/ and open welocome.blade.php. Then update the following code into your welcome.blade.php file as follow:

Step 7: Run Development Server

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