Category Archives: Blog

Blog

Laravel 8 maddhatter/laravel-fullcalendar Tutorial with Example

In this Laravel 8 maddhatter/laravel-fullcalendar Tutorial with Example I’ll show you how to install and use fullcalendar using maddhatter/laravel-fullcalendar package in laravel. In this tutorial you will learn to display events on the calendar using maddhatter/laravel-fullcalendar package in laravel 8. This tutorial you will also learn to show dynamic event, task or booking data on calendar using fullcalendar components in laravel 8. Fullcalendear package is mainly used appointment booking, event scheduling, task management application development in laravel.

Laravel 8 maddhatter/laravel-fullcalendar Tutorial with Example

In this step by step tutorial I will demonstrate you how to install and integrate fullcalendar components in laravel 8. Please follow instruction given below:

  • Step 1 – Install Laravel App
  • Step 2 – Connecting App to Database
  • Step 3 – Build Migration & Model
  • Step 4 – Install maddhatter/laravel-fullcalendar and Build Routes
  • Step 5 – Create Controller Using Artisan Command
  • Step 6 – Create Blade View
  • Step 7 – Run Development Server
  • Step 8 – Test This App

Step 1 – Install Laravel 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 – Build 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 Book and also create a migration file for the Events table. Now go to database/migrations folder and open create_books_table.php file. Then put the following code into create_books_table.php file, as follow:

Now, go to app/models and open Book.php file and add the following code into it:


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

Step 4 – Install maddhatter/laravel-fullcalendar and Build Routes

In this step, we will install maddhatter/laravel-fullcalendar Package via the composer dependency manager. Use the following command to install maddhatter/laravel-fullcalendar Package.

Now, open “config/app.php” file and register this package, as shown below:

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 5 – Create Controller Using Artisan Command

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

After successfully create controller, visit app/http/controllers directory and open FullCalendarController.php file.

Step 6 – Create Blade view

In this step we will create blade view file. Go to resources/views directory and create a blade view file named calendar.blade.php. 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 8 Generate PDF File using DomPDF Tutorial

In this Laravel 8 Generate PDF File using DomPDF Tutorial I will show you how to generate pdf file using DomPDF in laravel. In this tutorial you will learn to generate or convert a pdf file using DomPDF in laravel. In this example we will be using DomPDF library to generate pdf file. In this article I will show you how to install and use DomPDF package to generate pdf file in laravel. You will also learn to install DomPDF with laravel. Before starting with this tutorial you are required to install DomPDF package in laravel.

Laravel 8 Generate PDF File using DomPDF Tutorial

In this step by step tutorial I will demonstrate you how to install DomPDF  package in laravel. As well as I will also show you how to generate pdf file using DomPDF package in laravel. Please follow the instruction given below:

  • Step 1 – Download Laravel 8 Application
  • Step 2 – Install DomPDF Package
  • Step 3 – Register DOMPDF Package
  • Step 4 – Create PDF Routes
  • Step 5 – Create PDF Controller By Artisan Command
  • Step 6 – Create Blade View File
  • Step 7 – 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 – Install domPDF Package

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

Step 3 – Register DOMPDF Package

Now we will register this package in laravel application. So, Open the providers/config/app.php file and register the DOMPDF provider and aliases.

Step 4 – Create PDF 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 PDF Controller By Artisan Command

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

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

Step 6 – Create Blade File

Now, create blade view file for generate pdf from view. So, Go to resources/views and create testPDF.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 Flash Message Example Tutorial

In this Laravel 8 Flash Message Example Tutorial I will show you how to create or implement flash message in laravel 8 application. In this tutorial you will learn to implement flash message in laravel. While working with laravel application we come to situations where we want to show/display various flash success and error messages. In this example we will be using sweet alert js to display various type of flash messages or notifications.

Laravel 8 Flash Message Example Tutorial

In this step by step guide I will demonstrate you how you can implement success or error messages with sweet alert js in your laravel application.

Flash Messages in Laravel 8

In this tutorial we will learn to following types of flash messages

  • Success Flash Message
  • Error Flash Message
  • Warning Flash Message
  • Info Flash Message
  • Sweet Alert Flash Success Message
  • Sweet Alert Flash Error Message

1 – Success Flash Message

Below is example to display success flash message:

The second thing, When you send the success message. So you can use the below code in your controller:

The success flash message will look like:

2 – Error Flash Message

Below is example to display error flash message:

The second thing, add the below code in your controller, where you want to send the warning message:

3 – Warning Flash Message

Below is example to display warning flash message:

The second thing, add the below code in your controller, where you want to send the error message:

4 – Info Flash Message

Below is example to display info flash message:

The second thing, add the below code in your controller, where you want to send the info message:\

5 – Sweet Alert Flash Success Message

Below is example to sweet alert flash success message:

If you use the above code for a success message, this message automatically hides after 5 seconds.

6 – Sweet Alert Flash Error Message

Below is example to sweet alert flash error message:

If you use the above code for an error message, this message automatically hides after 5 seconds.

Laravel 8 Resource Route Controller Example Tutorial

In this Laravel 8 resource route, controller example tutoria I will show you how to create a resource route, controller, API resource route, and API resource controller in laravel 8. In this tutorial you will learn to create resource route, controller, API resource route and API resource controller in laravel. You will also learn to use resource controller and routes in laravel 8. In this article I will also show you how to create resource routes and controllers using the PHP artisan make command in laravel 8.

Laravel Resource Route and Controller

With laravel resource controller and resource route you can quick and easily CRUD operation in laravel. In order to create CRUD operation for any resource you have to create resource routes and controller. First you need to create resource route and then need to create resource controller to generate method for insert, update, view and delete operation for any resource.

Laravel 8 Resource Route Controller Example Tutorial

  • Controller Using Artisan Command
    • Create a Simple Controller
    • Create a Resource Controller
    • Create a Resource Controller with Model
  • Routes
    • Create Simple Routes
    • Create Resource Routes
  • API Controller and Routes

1:- Controller Using Artisan Command

Use the following command to create simple and resource controller in laravel 8 app.

Create a Simple Controller

Use the following artisan command to create simple controller in laravel:

The above command will create a simple controller file inside app/http/controllers directory. When you open newly created controller file it will look like:

Create a Resource Controller

Use the following artisan command to create resource controller in laravel:

The above command will create a resource controller file inside app/http/controllers directory. When you open newly created resource controller file it will look like:


The resource controller contains by default index (), create (), edit (), update (), destroy () method inside it.

Create a Resource Controller with Model

Use the following artisan command to create a resource controller with model file in laravel:

The above command will create resource controller along with a model file. The controller file has located inside app/http/controllers directory. And Model file is located inside app/Models directory.

If you open Model file, you will look like:

2:- Routes

Lets open “routes/web.php” file and add the following routes in it.

Create Simple Routes

Create Resource Routes

Then open terminal and run the following command on it:

The following command will display resource routes methods:

3:- API Controller and Routes

Create Resource Controller

Use the following artisan command to create a API resource controller:

The above command will create a simple controller file inside app/http/controllers/API directory. When you open newly created resource controller file it will look like:

Define Resource API Route

Lets open “routes/api.php” file and add the following routes in it.

routes/api.php

Laravel 8 Drag and Drop File/Image Upload using Dropzone JS

In this Laravel 8 Drag & Drop Image file Upload Using Dropzone js Example tutorial, I will show you how to create drag and drop image file upload functionality using dropzone js in laravel. In this tutorial you will learn to implement drag and drop image file upload using dropzone package in laravel. In this article you will learn to upload multiple image file with drag and drop using dropzone js in laravel. After upload we will be saving image files with unique name in database.

Laravel 8 Drag and Drop File/Image Upload using Dropzone JS

In this step by step tutorial I will demonstrate you with example to create drag and drop image file upload using dropzone js in laravel. Please follow the instruction given below:

  • Step 1 – Download Laravel 8 Application
  • Step 2 – Setup Database with App
  • Step 3 – Create Model & Migration
  • Step 4 – Create Routes
  • Step 5 – Generate Controller By Artisan Command
  • Step 6 – Create Blade View
  • Step 7 – Implement javascript Code for Dropzone Configuration
  • Step 8 – Create Images Directory inside Public Directory
  • 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

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 – Create Model & Migration

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

Now, open create_photos_table.php file inside LaravelImage/database/migrations/ directory. And the update the function up() with following code:


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

Step 4 – 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 5 – Generate Controller By Artisan Command

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

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


The following line of code will upload an image into the images directory:

Step 6 – Create Blade View

Now, create drag and drop multiple image file upload form in blade view file to display image upload form and submit to the database using dropzone js in laravel 8. Go to resources/views and create dropzone.blade.php and update the following code into it:

Step 7 – Implement javascript Code for Dropzone Configuration

Step 8 – Create Images Directory inside Public Directory

Do remember to create images directory inside public directory.

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 8 Middleware Example Tutorial

In this Laravel 8 Middleware Example Tutorial, I will show you how to create custom middleware and to use in laravel application. In this tutorial you will learn to create and use custom middlewalre in laravel. In this article I will share example to create simple custom middleware to check user status.

Laravel 8 Middleware Example Tutorial

In this step by step laravel middleware tutorial I will demonstrate you with example of active or inactive users. Now we will call middleware in routes to restrict logged user to access that routes.

  • Step 1: Create Middleware
  • Step 2 – Register Middleware
  • Step 3 – Implement Logic Into Your Middleware File
  • Step 4 – Add Route
  • Step 5 – Add Method in Controller

Step 1: Create Middleware

In this step we will first create a custom middleware in laravel based project. So let’s open your command prompt and run following command :

Step 2 – Register Middleware

Now, go to app/http/kernel.php and register your custom middleware here :

app/Http/Kernel.php

Step 3 – Implement Logic Into Your Middleware File

After successfully register your middleware in laravel project, go to app/http/middleware and implement your logic here :

app/Http/Middleware/CheckStatus.php

Step 4 – Add Route

Now, we will add some route with middleware as following

Step 5 – Add Method in Controller

Now we will create a method to check active or inactive users.

app/Http/Controllers/HomeController.php

Laravel 8 Charts JS Example Tutorial

In this Laravel 8 Charts JS Example Tutorial I will show you how to implement Charts JS in laravel 8 application. In this tutorial you will learn to implement Charts JS in laravel 8. In this example I will demonstrate the use of Charts JS in laravel application. In this example we will create pie chart using a chart js in laravel 8 application.

ChartJS is easy to use and simple HTML5 based JavaScript charts library. With Chart js we can create animated, interactive graphs in our laravel application.

Laravel 8 Charts JS Example Tutorial

In this step by step tutorial I will demonstrate you to fetch the last 7 days data and display it on pie chart using charts js in laravel. Please follow the instruction given below:

  • Step 1: Create a route
  • Step 2: Create Controller
  • Step 3: Create Blade View File and Integrate Chart js Library
  • Step 4: Start Development Server

Step 1: Create a route

In the first step we will define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Step 2: Create Controller

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

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

app/Http/Controllers/ChartJSController.php

 

Step 3: Create Blade View File and Integrate Chart js Library

Now, we will create a blade view file. Go to the resources/views/chart-js.blade.php and put the below javascript and HTML code for displaying the chart. So go to the resources/views/ and update the below javascript and HTML code for displaying the chart using chart js library:

Remember to include highchart js libraries on your blade file:


Use below javascript as per requirement :

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

How to Install Ckeditor in Laravel 8

In this How to Install Ckeditor in Laravel 8 tutorial I will show you how to install and use CKEditor in laravel. In this tutorial, you will learn to install CKEditor in laravel using the command line. In this article I will guide you through how to install and upload images and files using CKEditor in laravel.

While creating forms we come to situation where we may text editor field so that we can insert and save html and other text into database. The CKEditor editor is feature rich wysiwyg html editor allows us to integrate text editor fields in html form.

How to Install Ckeditor in Laravel 8

In this step by step tutorial I will demonstrate you how to install and use CKEditor editor in laravel 8 application. Please follow the instruction given below:

  • Step 1: Install Laravel 8 App
  • Step 2: Connecting App to Database
  • Step 3: Create Post Model & Migration
  • Step 4: Add Fillable Property in Model
  • Step 5: Make Route
  • Step 6: Create Controller
  • Step 7: Create Blade Views File
  • Step 8: Start 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: Create Post Model & Migration

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

Now, open create_posts_table.php file inside /database/migrations/ directory. And the update the function up() with following code:

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

Step 4: Add Fillable Property in Model

In this step, add the fillable property in Post model, which is located inside app/models directory:

Step 5: Make 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

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

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

app/Http/Controllers/PostController.php

Step 7: Create Blade Views File

In this step we will create blade view file. Go to resource/views direcotry and create two files name posts.blade.php and create.blade.php file. Create a blade view file name posts.blade.php and put the following code into it:

posts.blade.php


Now, create a blade view file name create.blade.php and put the following code into it:

create.blade.php


Note that, Don’t forget to add the following cdn file to your blade view file:

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 8 Livewire Load More On Page Scroll Example

In this Laravel 8 Livewire Load More On Page Scroll Example Tutorial I’ll show you how to implement infinity scroll or dynamix ajax load more pagination 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 8 Livewire Load More On Page Scroll Example

In this step by step tutorial I will demonstrate you with example to create dynamix ajax load more pagination on page scroll in laravel using livewire. Please follow the instruction given below:

  • Step 1: Install Laravel 8 App
  • Step 2: Connecting App to Database
  • Step 3: Run Migration and Add Dummy Data
  • Step 4: Install Livewire Package
  • Step 5: Create Load More Component using Artisan
  • Step 6: Make Route
  • Step 7: Create Blade View 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: Run Migration and Add Dummy Data

Now, run following command to migrate database schema.

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 livewire load more component using following artisan command:

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

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


Now, go to resources/views/livewire folder and open load-more-user-list.blade.php file. Then add the following code into your load-more-user-list.blade.php file:

Step 6: Make 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 a blade view file. Go to resources/views/folder and create a blade view files that name lists.blade.php file. Then put the following code into your 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 –

Laravel 8 Livewire Datatables Tutorial

In this Laravel 8 livewire dataTable example tutorial I will show you how to install and use livewire datatable in laravel 8 application. In this tutorial you will learn to install and use livewire datatable in your laravel project. In this article I will share example to install and use livewire datatable in laravel. We will be using mediconesystems/livewire-datatables package packge to use livewire datatable in laravel.

Laravel 8 Livewire Datatables Tutorial

In this step by step tutorial I will guide you through the process to install and use livewire datatable in your project. Please follow the instruction given below:

  • Step 1 – Download Laravel 8 App
  • Step 2 – Connecting App To Database
  • Step 3 – Install Livewire & DataTable Livewire
  • Step 4 – Build User DataTable Livewire Component
  • Step 5 – Create Routes
  • Step 6 – Update UserDataTable Component File
  • Step 7 – Update Welcome Blade File
  • Step 8 – Start Development Server

Step 1 – Download 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 Livewire & DataTable Livewire

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

Now, run the following command to build your assets:

To run npm:

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

Step 4 – Build User DataTable Livewire Component

In this step we will be creating livewire datatable component using following command:

The above command will create two files:

Step 5 – 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 6 – Update UserDataTable Component File

Now, update the UserDatatables.php component file with the following code, which is placed on app/Http/Livewire directory:

Step 7 – Update Welcome Blade File

In this step we will create blade view file. Open welcome.blade.php file and update the following code into it, which is placed on resources/views/ directory:

Now, run the following command to create dummy records in database:

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 8 Livewire File Upload Tutorial

In this Laravel 8 Livewire File Upload Tutorial I’ll show you how to upload file with livewire package in laravel 8 application. In this tutorial you will learn to upload file using livewire package in laravel. In this article I will share example to upload file using livewire file upload component. Laravel livewire package makes uploading and saving image files easy. With Laravel livewire package it is easy handle file upload.

Laravel 8 Livewire File Upload Tutorial

In this step by step tutorial I will demonstrate you how to upload file using livewire in laravel application. Please follow the instruction given below:

  • Step 1: Install Laravel 8 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 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.

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 Document.php and a migration create_documents_table.php. 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 migration to create database table using following artisan command:

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 livewire file upload component using following command:

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

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


Now, go to resources/views/livewire folder and open lara-file-upload.blade.php file. Then add 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 we will create blade file. Go to resources/views/livewire folder and create a blade view files welcome.blade.php file. Then add the following code into welcome.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 8 Summernote Image Upload Tutorial

In this Laravel 8 Summernote Image Upload Tutorial I will show you how to install and use Summernote with image upload in laravel. In this tutorial, you will learn to install Summernote with image upload in laravel. In this step by step guide you how to integrate Summernote  editor with image upload in laravel. Integration of Summernote editor in laravel form is simple process. I will also show you how to integrate or enable image upload in Summernote editor.

While creating forms we come to situation where we may text editor field so that we can insert and save html and other text into database. The summernote editor is feature rich wysiwyg html editor allows us to integrate text editor fields in html form.

Laravel 8 Summernote Image Upload Tutorial

In this laravel 8 summernote with image upload integration example I will guide you through step by step to install and use summernote editor with image upload in laravel 8 application. Please follow the instruction given below:

  • Step 1 – Install Laravel 8 App
  • Step 2 – Connecting App to Database
  • Step 3 – Create Migration and Model File
  • Step 4 – Add Routes
  • Step 5 – Create Controller
  • Step 6 – Create Blade File
  • 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 Migration and Model File

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

Next, go to database/migrations and open create_posts_table.php. Then put the following code into create_books_table.php file, as follow:


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

Now go to App directory and open Post.php model file. Then put the following code into Post.php model file, as follow:

app/Post.php

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

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

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

Step 6 – Create Blade File

In this step we will create blade file. Go to resources/views folder. And create a blade views  create.blade.php. Then open create.blade.php file and update the following code into create.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 –

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