Category Archives: Laravel

Laravel Tutorials

Vue JS And Laravel 8 Like Dislike Tutorial Example

In this Laravel 8 Vue JS Like Dislike Example Tutorial I’ll show you how to implement Like Dislike with Vue Js in laravel 8. In this tutorial you will learn to create Like Dislike with Vue Js in laravel 8. In this article I will demonstrate you with example how to implement Like Dislike with Vue Js in laravel 8.

Vue JS And Laravel 8 Like Dislike Tutorial Example

In this step by step tutorial we will learn to implement Like Dislike with Vue Js in laravel 8. Please follow the instruction given below:

  • Step 1: Install Laravel 8 App
  • Step 2: Connecting App to Database
  • Step 3: Create Migration Files
  • Step 4: Create Models
  • Step 5: NPM Configuration
  • Step 6: Add Routes
  • Step 7: Create Controller By Command
  • Step 8: Create Vue Component
  • Step 9: Initialize Vue Components
  • Step 10: 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: Create Migration Files

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

Now open create_countries_states_table.php migration file from database>migrations and replace up() function with the following code:

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

Step 4: Create Models

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

Step 5: NPM Configuration

Install all Vue dependencies:


To calling Laravel API routes. You need to install vue-axios. So use run the following command on command prompt:


After installing all dependencies run this command:

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

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

Go to app\Http\Controllers and open CountryStateController.php file. Then update the following code into your CountryStateController.php file:

Step 8: Create Vue Component

In this step we will create a Vue component. Go to resources/assets/js/components folder and create a filed called DropdownComponent.vue. And put the following code into your DropdownComponent.vue. components file:

 

Now open resources/assets/js/app.js and include the FileUpload.vue component like this:app.js

Step 9: Initialize Vue Components

Go to resources/views and create one folder named layouts. Inside this folder create one blade view file named app.blade.php file. Go to resources/views/layouts and open app.blade.php file. Then update the following code into your app.blade.php file as follow:

Step 10: Run Development Server

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

Laravel 8 Vue Js Drag & Drop Image Upload Using Dropzone

In this Laravel 8 Vue Js Drag & Drop Image Upload Using Dropzone Example tutorial, I will show you how to upload 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 8 Vue Js Drag & Drop Image Upload Using Dropzone

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

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

Step 5: Create ImageUplaod Vue Component

In this step we will create a Image upload component. Now, go to resources/assets/js/components folder and create a file called MultipleImageUploadComponent.vue. Then 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

In this step we will create blade view file, go to resources/views/ and open welocome.blade.php. Then put 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 –

Laravel 8 Vue JS Flash Message Tutorial

In this Laravel 7 Vue JS Flash Message Example Tutorial I’ll show you how to create Flash Message with Vue Js in laravel. In this tutorial you will learn to add Flash Message with Vue Js 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 article I will demonstrate you how to display various type of flash messages or notifications in laravel 8.

Laravel 8 Vue JS Flash Message Tutorial

In this step by step tutorial I will demonstrate you how to display Vue Js flash message in laravel 8. Please follow the instruction given below:

  • Step 1: Install Laravel 8 App
  • Step 2: Connecting App to Database
  • Step 3: Create Model And Migration
  • Step 4: NPM Configuration
  • Step 5: Add Routes
  • Step 6: Create Controller By Command
  • Step 7: Create Vue Component
  • Step 8: Register Vue App
  • Step 9: 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: Create Model And 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 post.php and also create a migration file for the posts table. Now open create_postss_table.php migration file from database>migrations  and put the following code:

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

Step 4: NPM Configuration

Install all Vue dependencies:

Step 5: 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 6: Create Controller By Command

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

Now, go to app\Http\Controllers and open PostController.php file. Then put the following code into your PostController.php file:

Step 7: Create Vue Component

In this step we will create a vue component. Go to resources/assets/js/components folder and create a file called Post.vue. Then put the following code into your Post.vue components file:

Now, create a new components named flash.vue and update the following code into flash.vue file:


Now open resources/assets/js/app.js and include the Post.vue and Flash.vue component as follow:


Step 8: Register Vue App

In this step, you need to create a blade view file to define Vue’s app. Go to resources/views folder and make a file named post.blade.php. Then update the below code into post.blade.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 8 Vue JS Datatables Tutorial with Example

In this Laravel 8 Vue JS Datatables Example Tutorial I’ll show you how to use Datatables with Vue Js in laravel. In this tutorial you will learn to use datatables with Vue Js in laravel. In this article I will demonstrate the use of Datatables with Vue Js with example in laravel 8.

Laravel 8 Vue JS Datatables Tutorial with Example

In this step by step tutorial I will show you how to implement and use Datatables with Vue Js in laravel 8. Please follow the instruction given below:

  • Step 1: Install Laravel 8 App
  • Step 2: Connecting App to Database
  • Step 3: Create Model And Migration
  • Step 4: NPM Configuration
  • Step 5: Add Routes
  • Step 6: Create Controller By Command
  • Step 7: Create Vue Component
  • Step 8: Create Blade Views And Initialize Vue Components
  • Step 9: 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: Create Model And 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 post.php and also create a migration file for the posts table. Open create_posts_table.php migration file from database>migrations and replace up() function with following code:

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


Now, go to app/Models/Post.php and put the following code into your Post.php model as follow:

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


Now, execute following command to generate fake records using faker as follow:

Step 4: NPM Configuration

Install all Vue dependencies:


Install vuejs-datatable:

Step 5: 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 6: Create Controller By Command

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

Now, go to app\Http\Controllers and open PostController.php file. Then put the following code into your PostController.php file:

Step 7: Create Vue Component

In this step we will create a Vue component. Go to resources/assets/js/components folder and create a file called DataTableComponent.vue. Now, update the following code into your DataTableComponent.vue components file:

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

Step 8: Create Blade Views And Initialize Vue Components

In this step we will create blade view files. Go to resources/views and create one folder named layouts. Inside this folder create one blade view file named app.blade.php file.

Now, go to resources/views/layouts and open app.blade.php file. Then put the following code into your app.blade.php file as follow:

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

Step 9: Run Development Server

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

Laravel 8 Vue JS Axios Get Request Tutorial Example

In this Laravel 8 Vue JS Axios Get Request Example tutorial, I’ll show you how to implement get request with Vue JS Axios in laravel. In this tutorial you will learn to create get request with Vue JS Axios in laravel. In this article I will demonstrate you to create get request with Vue JS Axios in laravel.

Laravel 8 Vue JS Axios Get Request Tutorial Example

In this step by step tutorial we will learn to create get request with Vue JS Axios in laravel. Please follow the instruction given below:

  • Step 1: Download Laravel Fresh Setup
  • Step 2: Setup Database Credentials
  • Step 3: Generate Fake Data
  • Step 4: Add Routes
  • Step 5: Create Controller By Command
  • Step 6: Install Vue Js dependency
  • Step 7: Create blade file and layout
  • Step 8: Run Development Server

Step 1: Download Laravel Fresh Setup

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

Step 2: Setup Database Credentials

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

Step 3: Generate Fake data

Now, in this step we will generate some dummy data.

Now, use the following artisan command to generate dummy data:

Step 4: Add Routes

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

routes/web.php

Step 5:  Create Controller By Command

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

Now, open app/Https/Controller/UserController.php and put the following methods into your UserController file:

Step 6: Install Vue Js dependency

In this step we will install required dependencies using following command:

Go to resources/assets/js/components/ folder. And create a new components name UserComponent.vue. Then put the following code into your UserComponent.vue file:

Go to resources/assets/js then open app.js file and intialize vue js components in this file. So open app.js file and update the following code into your app.js file:

Step 7: Create blade file and layout

Now, Open resources/layouts/app.blade.php and update the following code into it:


Next, resources/views/ and create a new blade view file name users.blade.php. And put  the following code into your users.blade.php view file:

Step 8: Run Development Server

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

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

Laravel 8 Vue JS Post Axios Request Tutorial

In this Laravel 8 Vue JS Post Axios Request Example tutorial, I’ll show you how to implement Post request with Vue JS Axios in laravel. In this tutorial you will learn to create Post request with Vue JS Post Axios in laravel. In this article I will demonstrate you to create Post request with Vue JS Post Axios in laravel.

Laravel 8 Vue JS Post Axios Request Tutorial

In this step by step tutorial we will learn to create post request with Vue JS post Axios in laravel. Please follow the instruction given below:

  • Step 1: Install Laravel 8 App
  • Step 2: Connecting App to Database
  • Step 3: Create Migration Files
  • Step 4: Create Models
  • Step 5: NPM Configuration
  • Step 6: Add Routes
  • Step 7: Create Controller By Command
  • Step 8: Create Vue Component
  • Step 9: Initialize Vue Components
  • Step 10: Run Development Server

Step 1: Install Laravel 8

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 Files

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

Now open create_countries_states_table.php migration file from database>migrations and replace up() function with the following code:

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

Step 4: Create Models

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

Step 5: NPM Configuration

Install all Vue dependencies:

To calling Laravel API routes. You need to install vue-axios. So use run the following command on command prompt:


After installing all dependencies run this command:

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

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

Now, go to app\Http\Controllers and open CountryStateController.php file. Then put the following code into your CountryStateController.php file:

Step 8: Create Vue Component

In this step we will create a vue component, go to resources/assets/js/components folder and create a filed called DropdownComponent.vue. And put the following code into your DropdownComponent.vue. components file:

Now open resources/assets/js/app.js and include the FileUpload.vue component like this:app.js

Step 9: Initialize Vue Components

In this step, go to resources/views and create one folder named layouts. Inside this folder create one blade view file named app.blade.php file. Next, Navigate to resources/views/layouts and open app.blade.php file. Then update the following code into your app.blade.php file as follow:

Step 10: Run Development Server

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

Laravel 8 Vue JS Infinite Scroll Load More Tutorial

In this Laravel 8 Vue JS Infinite Scroll Load More tutorial I’ll show you how to implement Infinite scroll pagination or dynamix ajax load more pagination in laravel with Vue Js. In this tutorial you will learn to implement Infinite scroll pagination or dynamic load more pagination in laravel with Vue Js . In this step by step guide I’ll share example of Vue JS Infinite Scroll Load More pagination in laravel 8.

Laravel 8 Vue JS Infinite Scroll Load More Tutorial

In this step by step tutorial I will demonstrate to create infinite scroll or load more pagination on page scroll with vue js and laravel 8 applicatons:

  • Step 1: Download Laravel Fresh Setup
  • Step 2: Setup Database Credentials
  • Step 3: Create Migration and Model File
  • Step 4: Generate Dummy Data
  • Step 5: Add Routes
  • Step 6: Create Controller By Command
  • Step 7:  Configuration Vue JS
  • Step 8: Update app.js And Default Components
  • Step 9:  Add Vue Components on welcome.blade.php file
  • Step 10: Start 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: 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 Migration and Model File

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

The above command will create post model, migration, and factory file into your project. Go to app/database/migrations and find posts migration file. Then open it and put the following code into posts migration file:

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

Step 4: Generate Dummy Data

Next step, generate fake or dummy data for posts table. So go to database/factories folder and find PostFactory.php file. After that, open and update the following code in PostFactory.php file as follow:

Next open terminal and run following command to generate dummy data for posts table:

Step 5: 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 6: Create Controller By Command

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

The above command will create PostController inside app/Http/Controllers/ folder. Now, open your PostController and update the following methods into your PostController File:

Step 7:  Configuration Vue JS

Now, you need setup Vue js. So open your terminal and execute the following commands one by one:

Install npm:

Install vue-resource:


Install vue-infinite-loading:

Step 8: Update app.js And Default Components

Go to resources/assets/js/ folder and find the app.js file inside this directory. Then update the following code into your app.js file:

resources/assets/js/app.js

resources/assets/js/components/ExampleComponent.vue

Step 9:  Add Vue Components on welcome.blade.php file

Go to resources/views and find welcome.blade.php file inside this folder. Then update the following code into your welcome.blade.php file:

And also update the following code into app.blade.php file, which is located on resources/views/layouts/ folder.

Step 10: Start Development Server

Laravel 8 FullCalendar Vue JS Tutorial Example

In this Laravel 8 FullCalendar Vue JS Tutorial Example tutorial I’ll show you how to display events on the calendar using vue js fullcalendar components in laravel 8 apps. In this tutorial you will learn to display events on the calendar using vue js fullcalendar in laravel 8. This tutorial you will also learn to show dynamic event data on vue js calendar using Vue full calendar components in laravel vue js.

Laravel 8 FullCalendar Vue JS Tutorial Example

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

  • Step 1: Install Laravel 8 App
  • Step 2: Connecting App to Database
  • Step 3: Create Model And Migration
  • Step 4: NPM Module Configuration For Vue Js
  • Step 5: Add Routes
  • Step 6: Create Controller By Command
  • Step 7: Create Vue Component
  • Step 8: Create Blade Views And Initialize Vue Components
  • Step 9: 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: Create Model And 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 Event.php and also create a migration file for the events table. Lets open create_events_table.php migration file from database>migrations and replace up() function with following code:

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


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

Step 4: NPM Module Configuration For Vue Js

Install all Vue dependencies:


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

Step 5: 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 6: Create Controller By Command

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

Go to app\Http\Controllers and open EventController.php file. Then put the following code into your EventController.php file:

Step 7: Create Vue Component

In this step we will create a Vue component. Go to resources/assets/js/components folder and create a file called FullCalendarComponent.vue. Now, put the following code into your FullCalendarComponent.vue components file:

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

Step 8: Create Blade Views And Initialize Vue Components

In this step we will create a blade view file. Go to resources/views and create one folder named layouts. Inside this folder create one blade view file named app.blade.php file. Now go to resources/views/layouts and open app.blade.php file. Then update the following code into your app.blade.php file as follow:

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

Step 9: Run Development Server

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

Laravel 8 Vue JS Owl Carousel Slider

In this Laravel 8 Vue JS Owl Carousel Slider Example tutorial, I’ll show you how to implement Owl carousel slider with Vue Js in laravel 8. In this tutorial you will learn to create Owl carousel slider with Vue Js in laravel 8. With Owl carousel you can create image slider in laravel project.

In this step by step tutorial I will demonstrate you how to implement Owl carousel slider with Vue Js in laravel 8. Please follow the instruction given below:

  • Step 1: Install Laravel 8 App
  • Step 2: Connecting App to Database
  • Step 3: Create Model And Migration
  • Step 4: NPM Module Configuration For Vue Js
  • Step 5: Add Routes
  • Step 6: Create Controller By Command
  • Step 7: Create Vue Component
  • Step 8: Create Blade Views And Initialize Vue Components
  • Step 9: 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: Create Model And 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 slider.php and also create a migration file for the sliders table. Lets open create_sliders_table.php migration file from database>migrations and replace up() function with following code:

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


Now, go to app/Models/Slider.php and update the following code into your Slider.php model as follow:

Step 4: NPM Module Configuration For Vue Js

Install all Vue dependencies:


After that, install owl carousel dependencies by using the below command:

Step 5: 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 6: Create Controller By Command

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

Now, go to app\Http\Controllers and open SliderController.php file. Then put the following code into your SliderController.php file:

Step 7: Create Vue Component

In this step we will create a Vue component. Now, go to resources/assets/js/components folder and create a file called SliderComponent.vueNow, put the following code into your SliderComponent.vue components file:

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

Step 8: Create Blade Views And Initialize Vue Components

In this step we will create a blade file. Go to resources/views and create one folder named layouts. Inside this folder create one blade view file named app.blade.php file.

Next, go to resources/views/layouts and open app.blade.php file. Then put the following code into your app.blade.php file as follow:

Now, go to resources/views/ and open welocome.blade.php. Then put the following code into your welcome.blade.php file as follow:

Step 9: Run Development Server

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

Laravel 8 Vue JS Live Search Tutorial

In this Laravel 8 Vue JS Live Search Tutorial I will show you how to create a live search box in  laravel Vue Js application. In this tutorial you will learn to create live search input box in laravel vue js application. In this article I will share example to create a dynamic ajax driven live search in Laravel with Vue Js. In this tutorial we will create a dynamic live search autocomplete which will fetch options from database table In Vue Js laravel application .

Laravel 8 Vue JS Live Search Tutorial

In this step by step tutorial I will demonstrate you to create a live search box in  laravel Vue Js application. Please follow the instruction given below:

  • Step 1: Install Laravel 8 App
  • Step 2: Connecting App to Database
  • Step 3: Run Make auth Command
  • Step 4: Create Model And Migration
  • Step 5: NPM Configuration
  • Step 6: Add Routes
  • Step 7: Create Controller By Command
  • Step 8: Create Vue Component
  • Step 9: Create Blade Views And Initialize Vue Components
  • Step 10: 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 Make auth Command

In this step we will run following commands to install laravel/ui and implement auth system:

This laravel laravel/ui package builds scaffold all of the routes, controller and views for authentication.

Step 4: Create Model And 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 post.php and also create a migration file for the posts table. Now open create_posts_table.php migration file from database>migrations and replace up() function with following code:

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

Now, go to app/Models/Post.php and put the following code into your Post.php model as follow:


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

Now we will run following command to generate fake data using faker as follow:

Step 5: NPM Configuration

Install all Vue dependencies:

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

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

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

Step 8: Create Vue Component

In this step we will create a Vue component. Go to resources/assets/js/components folder and create a file called SearchComponent.vue. Now, put the following code into your SearchComponent.vue components file:

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

Step 9: Create Blade Views And Initialize Vue Components

In this step we will create blade files. Go to resources/views and create one folder named layouts. Inside this folder create one blade view file named app.blade.php file.

Next, go to resources/views/layouts and open app.blade.php file. Then update the following code into your app.blade.php file as follow:

Next, go to resources/views/ and create one file name search.blade.php. Then put the following code into your search.blade.php file as follow:

Step 10: Run Development Server

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

Laravel 8 Vue JS CRUD Tutorial

In this Laravel 8 Vue JS CRUD Example Tutorial, I’ll show you how to create simple crud application using Vue Js in laravel. In this tutorial you will learn to create basic crud application with Vue Js in laravel 8. In this step by step tutorial I’ll demonstrate the implementation of simple crud application using Vue Js in laravel 8.

Laravel 8 Vue JS CRUD Tutorial

In this step by step guide, we will be creating a simple crud operation application with validation in laravel 8. In this example you will learn how to insert, read, update and delete data from database in laravel 8.

  • Install 8 Laravel 8 App
  • Connecting App to Database
  • Install NPM Dependencies
  • Create Migration, Model and Controller
  • Define Routes In web.php
  • Create Vue Js App
  • Create Vue Js Components For Crud App
  • Define Vue Js Routes For Crud App
  • Include Vue Js Dependencies to app.js
  • Run Development Server

Step 1: Install 8 Laravel 8 App

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

Now, you need to setup Vue Js In Laravel 8 and install Vue Js dependencies using NPM. So execute the following command on command prompt.

Now, install vue-router and vue-axios. vue-axios will be used for calling Laravel API. execute the following command on your command prompt:

After installing all dependencies execute this command on terminal:

Step 4: Create Migration, Model and Controller

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

Now open create_posts_table.php migration file from database>migrations and replace up() function with this:create_posts_table.php

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


Now, Open Post.php model file, which is placed inside app/models directory and update the code into Post.php model:

Now run following command to create PostController.php file:

Next open PostController and define index, add, edit, delete methods in PostController file. So Go to app>Http>Controllers>API folder and open PostController.php file. Then update the following method into this:

Step 5: Define Routes in Web.php

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

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

routes/api.php

Step 6: Create Vue Js App

In this step we will create Vue Js app, go to resources/views and create one folder named layouts. Inside this folder create a blade view file named app.blade.php file.

Now, go to resources/views/layouts and open app.blade.php file. Then put the following code into your app.blade.php file as follow:

Step 7: Create Vue Js Components For Crud App

In this step, go to resources>js folder and create the following vue js component files:

Here, App.vue would be the main Vue file. Lets define router- view in the file. Now all route pages will be displayed on the App.vue file. Go to App.vue file and put the following code into your file:

Next, Open AllPosts.vue file and update the following code into your file:


Next, Open AddPost.vue file and update the following code into your file:


Next, Open EditPost.vue file and update the following code into your file:

Step 8: Define Vue Js Routes For Crud App

Now, you need to define vue routes. So go to resources>js folder, create a file named routes.js and update the following routes into your routes.js file:

Step 9: Include Vue Js Dependencies to app.js

Now, you need to add all routes, vue axios and other dependencies etc. So Go to resources>js folder and open app.js. Then update the following code into your app.js file:

Step 10: Run Development Server

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

Laravel 8 Socialite Login with Github Example Tutorial

In this Laravel 8 Socialite Login with Github Example Tutorial I’ll show you how to integrate Github login in laravel 8 using socialite package. Integrating Github login in Laravel 8 using socialite package is much easier. Allowing users to login with their social media accounts makes registration/login process much easier, it also encourages more users to register for your application.

Laravel 8 Socialite Login with Github Example Tutorial

In this step by step tutorial, you will learn to integrate Github login with your laravel 8 application. Please follow the steps give below:

  • Step 1 – Install Laravel 8 App
  • Step 2 – Configure Database With App
  • Step 3 – Configure Github App
  • Step 4 – Install Socialite & Configure
  • Step 5 – Add Field In Table Using Migration
  • Step 6 – Install Jetstream Auth
  • Step 7 – Make Routes
  • Step 8 – Create Controller By Command
  • Step 9 – Implement Github Login In Login Page
  • Step 10 – 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 – Configure Database With App

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

Step 3 – Configure Github App

In this step we will create github App for github social login. Use the link provided to create twitter app.

Here you have to click New Auth APP button to Create your app. After this you need to register a new OAuth application page will open. So fill your app detail and submit it, Finally, you will see dashboard of your created github app. Now, copy your github app details.

Now, add GitHub app details into service.php file. Go to config directory and open service.php file. Then add the client id and secret got from github app into service.php file:

Step 4 – Install Socialite & Configure

In this step we will Install Socialite Package via Composer using following command:

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

config/app.php

Step 5 – Add Field In Table Using Migration

In this step we will create migration to add some fields using following command:

After that, open the add_social_login_field.php file, which is found inside database/migration directory and add the following code into it:


After successfully add field in database table. Then add fillable property in User.php model, which is found inside app/Models/ directory:


Now, run following command to migrate database schema.

Step 6 – Install Jetstream Auth

In this step we will Install Laravel Jetstream Package via Composer using following command:

Now, you have to install livewire with jetstream. Use the following command to install livewire with jetstream in laravel application:

Install necessary NPM dependency:

Start node development server:

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

Step 7 – Make Routes

In this step, Go to routes directory and open web.php file. Then add the following routes into web.php file:

Step 8 – Create Controller By Command

In this step, run the following command to create GithubSocialController.php file:

Now, go to app/http/controllers directory and open SocialGithubController.php file in any text editor. Then put the following code into SocialGithubController.php file:

Step 9 – Implement Github Login In Login Page

In this step, implement github login button into login.blade.php file. So, open login.blade.php, which is found inside resources/views/auth/ directory:

Step 10 – 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 –