Topic: VueJs

Vue js Axios HTTP Delete Method Example Tutorial 0

Vue js Axios HTTP Delete Method Example Tutorial From Scratch

Today, We want to share with you Vue js Axios HTTP Delete Method Example Tutorial From Scratch.In this post we will show you VUEJS and Axios GET, POST, PUT and DELETE Methods, hear for vue axios tutorial,vue axios post,vue axios github,vuejs axios example,install axios vue we will give you demo and example for implement.In this post, we will learn about Vue.js REST API Consumption with Axios with an example.

Vue js Axios HTTP Delete Method Example Tutorial From Scratch

There are the Following The simple About Vue js Axios HTTP Delete Method Example Tutorial From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Handling Ajax Request in Vue Applications Using Axios, so the some simple API calls with Vue.js and Axios for this example is following below.

First of all We will Simple showing step by step Vue and Axios GET Methods with Example as well as Vue js Axios HTTP Post Method Example Tutorial From Scratch and vuejs crud Vue js Axios HTTP Put Method Example now I am learning To Most Imp Mwthods for Vuejs With Axios Delete Methods with Example.

Let’s learn how to Include a method for all the list of the data deleting members. In the main file like name as APIService.js class, and then to call the following axios with delete method in vuejs:

Vue and Axios Delete

Javascript with Vuejs HTTP Delete Requests with Axios

import {APIService} from '../APIService';
const API_URL = 'http://localhost:8000';
const apiService = new APIService();

// Vue and Axios Delete
deleteMember(member){
    const url = `${API_URL}/api/members/${member.pk}`;
    return axios.delete(url);
}

The simple vuejs deleteMember() use the main call request to all the primary key to delete this member using axios.delete() method to server side call send a DELETE http request to the main class API server.

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Vue js Axios HTTP Delete Method Example Tutorial From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Vue js Axios HTTP Put Method Example Tutorial From Scratch 0

Vue js Axios HTTP Put Method Example Tutorial From Scratch

Today, We want to share with you Vue js Axios HTTP Put Method Example Tutorial From Scratch.In this post we will show you VUEJS and Axios GET, POST, PUT and DELETE Methods, hear for How to make simple API calls with Vue.js and Axios we will give you demo and example for implement.In this post, we will learn about Handling Ajax Request in Vue Applications Using Axios with an example.

Vue js Axios HTTP Put Method Example Tutorial From Scratch

There are the Following The simple About Vue js Axios HTTP Put Method Example Tutorial From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Vue.js REST API Consumption with Axios, so the some Vuejs HTTP Requests with Axios for this example is following below.

First of all We will Simple showing step by step Vue and Axios GET Methods with Example as well as Vue js Axios HTTP Post Method Example Tutorial From Scratch now I am learning To Most Imp Mwthods for Vuejs With Axios PUT Methods with Example.

Vue and Axios PUT

Javascript with Vuejs HTTP PUT Requests with Axios

let’s display the source code for crating vuejs an http PUT request method which can be used to All the members update data. In the main javascript class APIService.js class Include the following Put method:

import {APIService} from '../APIService';
const API_URL = 'http://localhost:8000';
const apiService = new APIService();

// Vue and Axios Put
updateMember(member){

    const url = `${API_URL}/api/members/${member.pk}`;
    return axios.put(url,member);
}

The simple vuejs updateMember() method creates a call PUT method to the API server side by using the vuejs simple call a axios.put() method.

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Vue js Axios HTTP Put Method Example Tutorial From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Vue js Axios HTTP Post Method Example Tutorial From Scratch 0

Vue js Axios HTTP Post Method Example Tutorial From Scratch

Today, We want to share with you Vue js Axios HTTP Post Method Example Tutorial From Scratch.In this post we will show you Vue and Axios Post Example, hear for Vue js Axios HTTP Get And Post Method Example Tutorial From Scratch we will give you demo and example for implement.In this post, we will learn about How to make simple API calls with Vue.js and Axios with an example.

Vue js Axios HTTP Post Method Example Tutorial From Scratch

There are the Following The simple About Vue js Axios HTTP Post Method Example Tutorial From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Vue.js REST API Consumption with Axios, so the some vue cli axios,import axios vue,vue axios cdn,Vue and Axios GET & POST for this example is following below.

First of all We will Simple showing step by step Vue and Axios GET Methods with Example and now I am learning To Most Imp Mwthods for Vuejs With Axios Post Methods with Example.

Vue and Axios Post

Let’s start now display how we can vuejs post data to simple All the json/array RESTful API send to server data an http POST API call using vuejs Axios. Include the following Post method to the main file like as APIService.js class:

Javascript with Vuejs HTTP POST Requests with Axios

import {APIService} from '../APIService';
const API_URL = 'http://localhost:8000';
const apiService = new APIService();

// Vue and Axios Post
createMember(member){

    const url = `${API_URL}/api/member/`;
    return axios.post(url,member);
}

I am declared a simple javascript function like name a createMember() which takes a member object and The all send it via a vuejs POST request methods using axios.post() method.And then The function returns a simple response Promise which can be some more relavants resolved to message like success or error results response.

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Vue js Axios HTTP Post Method Example Tutorial From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Vue js Axios HTTP Get Method Example Tutorial From Scratch 0

Vue js Axios HTTP Get Method Example Tutorial From Scratch

Today, We want to share with you Vue js Axios HTTP Get Method Example Tutorial From Scratch.In this post we will show you Vuejs HTTP Requests with Axios, hear for Vue.js REST API Consumption with Axios we will give you demo and example for implement.In this post, we will learn about How to make simple API calls with Vue.js and Axios with an example.

Vue js Axios HTTP Get Method Example Tutorial From Scratch

There are the Following The simple About Vue js Axios HTTP Get Method Example Tutorial From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Vue.js REST API Consumption with Axios, so the some Vue Axios Tutorial by Example (CRUD API) for this example is following below.

Vue.js HTTP Get with Axios

frontend/src/APIService.js

Let’s step by step Learning the list of members using an VueJS HTTP GET request. Include the following source code to the main file like name APIService.js:

getMembers() {
    const url = `${API_URL}/api/members/`;
    return axios.get(url).then(response => response.data);
}

We declared a getMembers() method which makes a GET call, using the axios.get() method

Syntax of the Vuejs Get Methods

We also need a method to get single members by id or primary key. Let’s add a second method to APIService.js:

getMember(pk) {
    const url = `${API_URL}/api/members/${pk}`;
    return axios.get(url).then(response => response.data);
}

Example Using Http GET Calls

First of all We Make a Vue components for displaying members. Path a all the source code inside frontend/src/components and then run the following simple command:

touch ListMembers.js

Open the ListMembers.js file and start by adding a template:

<template>
<div>
<h1>Members ()</h1>
<b>How to make simple API calls with Vue.js and Axios Example</b>
<table class="table table-bordered table-hover">

<thead>
<tr>
<th>#</th>
<th>Member First Name</th>
<th>Member Last Name</th>
<th>Member Email</th>
<th>Member Mobile</th>
<th>Member Address </th>
<th>Actions</th>
</tr>
</thead>
<tbody>
	<tr v-for="member in members">
		<th>{ { member.pk } }</th>
		<th>{ { member.first_name } }</th>
		<td>{ { member.last_name } }</td>
		<td>{ { member.email } } </td>
		<td>{ { member.phone } }</td>

		<td>{ { member.address } }</td>
		<td>
		<button class="btn btn-danger" @click="deleteMember(member)"> X</button>
		</td>
	</tr>
</tbody>
</table>
<div>
</div>
</div>
</template>

Javascript with Vuejs HTTP Requests with Axios

I simple latest use the v-for main directive to each loop through the get members array and showing the information about each member in a main simple HTML table.

<script>
import {APIService} from '../APIService';
const API_URL = 'http://localhost:8000';
const apiService = new APIService();
export default {
name: 'ListMembers',
components: {
},
data() {
	return {
		members: [],
		numberOfMembers:0,
	};
},
methods: {
getMembers(){
    apiService.getMembers().then((data) => {
        this.members = data.data;
        this.numberOfMembers= data.count;
    });
},
},
mounted() {
this.getMembers();
},
}
</script>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Vue js Axios HTTP Get Method Example Tutorial From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

How to pass vuejs id attributes using bootstrap popup modal 0

How to pass vuejs id attributes using bootstrap popup modal

How to pass vuejs id attributes using bootstrap popup modal

In this Post We Will Explain About is How to pass vuejs id attributes using bootstrap popup modal With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to How to pass Vuejs variable to bootstrap modal – Vuejs Example

In this post we will show you Best way to implement Passing data form v-for loop to modal component, hear for Dynamic Modal Content With Vue.js with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

vue send variable to bootstrap modal

In this Example,First of all Add or Inluce External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priorty set.After that Include your relavant CSS Class.

include external libs

vue.js
bootstrap.min.css
jquery-3.2.1.min.js
bootstrap.min.js

index.html

<!-- Devloped by Pakainfo.com free download examples -->
<div id="liveApp">
  <div id="live-model" class="modal fade">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
		<!-- Devloped by Pakainfo.com free download examples -->
          <h5 class="modal-title">Products Clicked!</h5>
          <button type="button" class="close">
            <span>×</span>
          </button>
        </div>
		<!-- Devloped by Pakainfo.com free download examples -->
        <div class="modal-body">
          <p>Product Name: {{ name }}</p>
          <p>Product Description: {{ productDescription }}</p>
          <p>Product Price: {{ price }}</p>
        </div>
		<!-- Devloped by Pakainfo.com free download examples -->
        <div class="modal-footer">
          <button type="button" class="btn btn-primary">Data Save changes</button>
          <button type="button" class="btn btn-secondary">Close</button>
        </div>
      </div>
    </div>
  </div>

  <!--Pakainfo.com codes ommited -->
  <div>
      <li>
          <span>{{ prod.productName }}</span>
          <span>{{ prod.productPrice }}</span>
          <span><button>ShowMore</button></span>
      </li>
  </div>
</div>
<!-- Devloped by Pakainfo.com free download examples -->

index.js

var vm = new Vue({
    el: '#liveApp',
    data: {
       name: '',
       productDescription: '',
       price: 0,
       products: [
           {productName: 'prod1', productDesc: 'blabla', productPrice: 10},
           {productName: 'prod2', productDesc: 'lala', productPrice: 20},
           {productName: 'prod3', productDesc:'aaaaa', productPrice: 30}
       ]
    },
    methods: {
        prodClicked: function(prod) {
        	this.name = prod.productName;
          this.productDescription = prod.productDesc;
          this.price = prod.productPrice;
					$("#live-model").modal('show');
        }
    }
});

You are Most welcome in my youtube Channel Please shubscibe my channel. and give me feedBackMore Details……
Vuejs Example

Example

I hope you have Got What is How to pass vuejs id attributes using bootstrap popup modal And how it works.I would Like to have FeaeBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

vuejs onchange Event – vuejs v-on change Examples 0

vuejs onchange Event - vuejs v-on change Examples

vuejs onchange Event – vuejs v-on change Examples

In this Post We Will Explain About is vuejs onchange Event – vuejs v-on change Examples With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Vue.JS on change event Example

In this post we will show you Best way to implement Vue.JS on change event Example, hear for vuejs Input Events,vuejs Mouse Events,vuejs Click Events,vuejs Load Events with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

vuejs HTML DOM Events Examples

In this Example,First of all Add or Include External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priority set.After that Include your relevant CSS Class.

Vue.JS on change event Simple Example– It is very Easy to add onchange simple event on any HTML DOM input element.Examples of using Vuejs to react to events

Include External Libs

index.html

<div id="liveApp">
    {{ comments }}
    <span>{{myVal}}</span><br />
    
</div>

index.js

new Vue({
    el: '#liveApp',
    data: {
        comments: 'Vuejs On change event simple example',
        myAge: 50
    },
    watch: {
        'myAge': function(val, preVal){
        if (val < 50) {
            this.comments= 'Your Age is less than 50';
        }else{
          this.comments= 'Your Age is greater than 50';
        }
      }
    }
})

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is vuejs Input Events,vuejs Mouse Events,vuejs Click Events,vuejs Load Events And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

VueJS Routing and Templating example 0

VueJS Routing and Templating example

VueJS Routing and Templating example

In this Post We Will Explain About is VueJS Routing and Templating example With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Getting Started VueJS – Creating Routes With Vue-Router Example

In this post we will show you Best way to implement Vue.js Routing With vue-router in template, hear for Getting Started With Vue Router and Templating with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Vuejs Direct Download from CDN

The latest version of vue-router is available at Direct Download from CDN

Using NPM Vuejs Install

npm  install vue-router

Include External Libs

index.html

<div id="liveApp">
  /Contact
  /About
  
</div>

index.js

const Contact = { template: '<div>Contact</div>' }
const About = { template: '<div>About</div>' }

const router = new VueRouter({
  mode: 'history',
  routes: [
    { path: '/', component: Contact },
    { path: '/About', component: About }
  ]
})

new Vue({
	router,
  el: '#liveApp',
  data: {
    msg: 'Welcome to Pakainfo.com - Good Morning Hello World'
  }
})

VueJS – Routing Example

   
      <title>Simple VueJs Instance Example</title>
      
      
   
   
      <div id="liveApp">
         <h1>Routing Example</h1>
         <p>
            Home Link 1
            About Link 2
         </p>
         
      </div>
      
         const Home = { template: '<div style="background-color:cyan;width:250px;height:50px;margin:15px;font-size:25px;padding:15px">Welcome - This is Home 1</div>' }
         const About = { template: '<div style="background-color:green;width:250px;height:50px;margin:15px;font-size:25px;padding:15px">Welcome - This is About 2</div>' }
         const routes = [
            { path: '/home', component: Home },
            { path: '/about', component: About }
         ];
         const router = new VueRouter({
            routes 
         });
         var vm = new Vue({
            el: '#liveApp',
            router
         });
      
   

VueJS Routing and Templating

Example

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

I hope you have Got What is Introduction to Routing in Vue.js with vue-router And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Date filtering and formatting in VueJS with Example 0

Date filtering and formatting in VueJS with Example

Date filtering and formatting in VueJS with Example

In this Post We Will Explain About is Date filtering and formatting in VueJS with Example With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to javascript – Format Date time in vuejs Example

In this post we will show you Best way to implement Convert JSON date to JavaScript date in vuejs, hear for vuejs Set Custom Date Format Using Date Filter with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Include External Libs

https://cdnjs.cloudflare.com/ajax/libs/vue/0.12.4/vue.js

index.html

<button>Live SetDate</button>
<br />
MyDate: {{ mydate | date }}<hr />
{{$data|json}}

index.js

Vue.filter('date', {
read: function (liveVal) {
return vueDateformat(parseDate(liveVal));
},
write: function (liveVal, oldVal) {
var d = parseDate(liveVal);
return d ? vueDateformat(d) : liveVal
}
});

new Vue({
el: document.body,
data: { mydate: new Date() },
})

// super simple pt-BR date parser
function parseDate(liveString) {
if(liveString === null || isDate(liveString)) return liveString || null;
var p = liveString.match(/^(\d{1,2})\/?(\d{1,2})?\/?(\d{2,4})?$/);
if(!p) return null;
return new Date(parseInt(p[3] || new Date().getFullYear()), parseInt(p[2] || (new Date().getMonth() + 1)) - 1, parseInt(p[1]), 0, 0, 0, 0);
}

//Pakainfo.com super simple pt-BR date format
function vueDateformat(sdate) {
if(sdate == null) return '';
var f = function(d) { return d < 10 ? '0' + d : d; };
return f(sdate.getDate()) + '/' + f(sdate.getMonth() + 1) + '/' + sdate.getFullYear();
}

//date in Vue  is object a date?
function isDate(d) {
return Object.prototype.toString.call(d) === '[object Date]';
}

vuejs Date Filter with Example

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is vuejs Set Custom Date Format Using Date Filter And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Laravel Vue JS CRUD Example Tutorial From Scratch 0

Laravel Vue JS CRUD Example Tutorial From Scratch

Today, We want to share with you Laravel Vue JS CRUD Example Tutorial From Scratch.In this post we will show you Vue.js Laravel CRUD Example Tutorial From Scratch, hear for Creating a simple CRUD application with Laravel 5 and Vue.js we will give you demo and example for implement.In this post, we will learn about Laravel 5.7 and Vue JS CRUD with Pagination example and demo with an example.

Laravel Vue JS CRUD Example Tutorial From Scratch

There are the Following The simple About Laravel Vue JS CRUD Example Tutorial From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Laravel 5.5 – VueJS 2.0 CRUD Operations, so the some major files and We Need Server Requirements for this example is following below.

  • Apache/Nginx
  • CMD To install Composer
  • Mbstring PHP Extension
  • Databse for MySQl
  • simple Teminal NodeJs with NPM
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Latest Version Of the PHP >= 7.0.0
  • Tokenizer PHP Extension
  • XML PHP Extension

Step : 1 Make Laravel Latest Version Install Project:

Install Laravel Project

composer create-project --prefer-dist laravel/laravel Atmiya25

Step : 2 Settings .env

reate laravel project open Set .env file and setting your database connection setting

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=Atmiya25
DB_USERNAME=root
DB_PASSWORD=

Step : 3 Build Mobile Table Migration

run following CMD To command and build migration file

php artisan make:migration create_mobile_table --create=mobiles

migration/database

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMobileTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mobiles', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->text('mobileinformation');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mobiles');
    }
}

and then Run this command

php artisan migrate

Step : 4 Make Mobile Table Laravel Model And Controller:

Make Mobile table model and controller build this command

php artisan make:model Mobile -r

app/Mobile.php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Mobile extends Model
{
    protected $fillable = [
        'title',
        'mobileinformation',
    ];
}

app/Http/Controllers/MobileController.php

namespace App\Http\Controllers;

use App\Mobile;
use Illuminate\Http\Request;

class MobileController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $mobiles = Mobile::get();
        return response()->json([
            'mobiles'    => $mobiles,
        ], 200);
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $this->validate($request, [
            'title'        => 'required|max:255',
            'mobileinformation' => 'required',
        ]);
 
        $mobile = Mobile::create([
            'title'        => request('title'),
            'mobileinformation' => request('mobileinformation'),
        ]);
 
        return response()->json([
            'mobile'    => $mobile,
            'message' => 'Success'
        ], 200);
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\Mobile  $mobile
     * @return \Illuminate\Http\Response
     */
    public function show(Mobile $mobile)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Mobile  $mobile
     * @return \Illuminate\Http\Response
     */
    public function edit(Mobile $mobile)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Mobile  $mobile
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, Mobile $mobile)
    {
        $this->validate($request, [
            'title'        => 'required|max:255',
            'mobileinformation' => 'required',
        ]);
 
        $mobile->title = request('title');
        $mobile->mobileinformation = request('mobileinformation');
        $mobile->save();
 
        return response()->json([
            'message' => 'Mobile updated successfully!'
        ], 200);
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\Mobile  $mobile
     * @return \Illuminate\Http\Response
     */
    public function destroy(Mobile $mobile)
    {
        //
    }
}

Step : 5 Make Laravel Mobile Route:

resource Route (web.php)

Route::resource('/mobiles', 'MobileController');	

Step : 6 Simple Register Vue Component:

/resources/assets/js/app.js

require('./bootstrap');

window.Vue = require('vue');

Vue.component('example', require('./components/Example.vue'));

Vue.component('mobiles', require('./components/Mobile.vue'));

const app = new Vue({
    el: '#app'
});	

/resources/views/home.blade.php

@extends('layouts.app')

@section('content')
<mobiles></mobiles>
@endsection

Step : 7 Make Simple VueJS Component:

component file in /resources/assets/js/components/Mobile.vue

<template>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">My Mobile</div>

                    <div class="panel-body">
						<h2>Laravel Vue JS CRUD Example Tutorial From Scratch</h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<template>
<b>Laravel Vue JS CRUD Example Tutorial From Scratch Step By step</b>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <button @click="initAddMobile()" class="btn btn-success btn-xs pull-right">
                            + Add New Mobile
                        </button>
                        My Mobile
                    </div>

                    <div class="panel-body">
                        <table class="table table-bordered table-striped table-responsive" v-if="mobiles.length > 0">
                            <tbody>
                                <tr>
                                    <th>
                                        No.
                                    </th>
                                    <th>
                                        Title
                                    </th>
                                    <th>
                                        Information
                                    </th>
                                    <th>
                                        Action
                                    </th>
                                </tr>
                                <tr v-for="(mobiles, index) in mobiles">
                                    <td>{{ index + 1 }}</td>
                                    <td>
                                        {{ mobiles.title }}
                                    </td>
                                    <td>
                                        {{ mobiles.mobileinformation }}
                                    </td>
                                    <td>
                                        <button @click="initUpdate(index)" class="btn btn-success btn-xs">Edit</button>
                                        <button @click="deleteMobile(index)" class="btn btn-danger btn-xs">Delete</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal fade" tabindex="-1" role="dialog" id="add_mobile_model">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">×</span></button>
                        <h4 class="modal-title">Add New Mobile</h4>
                    </div>
                    <div class="modal-body">

                        <div class="alert alert-danger" v-if="errors.length > 0">
                            <ul>
                                <li v-for="error in errors">{{ error }}</li>
                            </ul>
                        </div>

                        <div class="form-group">
                            <label for="title">Title:</label>
                            <input type="text" name="title" id="title" placeholder="Title Name" class="form-control"
                                   v-model="mobiles.title">
                        </div>
                        <div class="form-group">
                            <label for="mobileinformation">Information:</label>
                            <textarea name="mobileinformation" id="mobileinformation" cols="30" rows="5" class="form-control"
                                      placeholder="Mobile Information" v-model="mobiles.mobileinformation"></textarea>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                        <button type="button" @click="createMobile" class="btn btn-primary">Submit</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal fade" tabindex="-1" role="dialog" id="update_mobile_model">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                        <h4 class="modal-title">Update Mobile</h4>
                    </div>
                    <div class="modal-body">
 
                        <div class="alert alert-danger" v-if="errors.length > 0">
                            <ul>
                                <li v-for="error in errors">{{ error }}</li>
                            </ul>
                        </div>
 
                        <div class="form-group">
                            <label>Title:</label>
                            <input type="text" placeholder="Title" class="form-control"
                                   v-model="update_mobile.title">
                        </div>
                        <div class="form-group">
                            <label for="mobileinformation">Information:</label>
                            <textarea cols="30" rows="5" class="form-control"
                                      placeholder="Task Information" v-model="update_mobile.mobileinformation"></textarea>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-success" data-dismiss="modal">Close</button>
                        <button type="button" @click="updateMobile" class="btn btn-primary">Submit</button>
                    </div>
                </div>
            </div>
        </div>

    </div>
</template>

<script>
    export default {
        data(){
            return {
                mobiles: {
                    title: '',
                    mobileinformation: ''
                },
                errors: [],
                mobiles: [],
                update_mobile: {}
            }
        },
        mounted()
        {
            this.readMobiles();
        },
        methods: {
            initAddMobile()
            {
                this.errors = [];
                $("#add_mobile_model").modal("show");
            },
            createMobile()
            {
                axios.mobile('/mobiles', {
                    title: this.mobiles.title,
                    mobileinformation: this.mobiles.mobileinformation,
                })
                    .then(response => {

                        this.reset();

                        $("#add_mobile_model").modal("hide");

                    })
                    .catch(error => {
                        this.errors = [];
                        if (error.response.data.errors.title) {
                            this.errors.push(error.response.data.errors.title[0]);
                        }

                        if (error.response.data.errors.mobileinformation) {
                            this.errors.push(error.response.data.errors.mobileinformation[0]);
                        }
                    });
            },
            reset()
            {
                this.mobiles.title = '';
                this.mobiles.mobileinformation = '';
            },
            readMobiles()
            {
                axios.get('/mobiles')
                    .then(response => {

                        this.mobiles = response.data.mobiles;

                    });
            },
            initUpdate(index)
            {
                this.errors = [];
                $("#update_mobile_model").modal("show");
                this.update_mobile = this.mobiles[index];
            },
            updateMobile()
            {
                axios.patch('/mobiles/' + this.update_mobile.id, {
                    title: this.update_mobile.title,
                    mobileinformation: this.update_mobile.mobileinformation,
                })
                    .then(response => {
 
                        $("#update_mobile_model").modal("hide");
 
                    })
                    .catch(error => {
                        this.errors = [];
                        if (error.response.data.errors.title) {
                            this.errors.push(error.response.data.errors.title[0]);
                        }
 
                        if (error.response.data.errors.mobileinformation) {
                            this.errors.push(error.response.data.errors.mobileinformation[0]);
                        }
                    });
            },
            deleteMobile(index)
            {
                let conf = confirm("Do you ready want to delete this mobile?");
                if (conf === true) {

                    axios.delete('/mobiles/' + this.mobiles[index].id)
                        .then(response => {

                            this.mobiles.splice(index, 1);

                        })
                        .catch(error => {

                        });
                }
            }
        }
    }
</script>

Step : 8 Run Laravel 5.5 – VueJS 2.0 CRUD Operations:

Simple Laravel 5.5 – VueJS 2.0 CRUD Operations Project Run

//Install NPM
npm install

//run Project
npm run dev

php artisan serve

//Run URL in Browsers
http://localhost:8000/

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel Vue JS CRUD Example Tutorial From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Simple Digital Clock with Date using VueJS 0

Simple Digital Clock with Date using VueJS

Simple Digital Clock with Date using VueJS

Today, We want to share with you Simple Digital Clock with Date using VueJS.
In this post we will show you Digital Clock with Vue.js, hear for vuejs digital clock with date we will give you demo and example for implement.
In this post, we will learn about Simple digital clock built with Vue with an example.

Simple Digital Clock with Date using VueJS

Simple Digital Clock with Date using VueJS

Getting Started for Digital Clock with Vue.js

We have used CDN(libes) for vuejs so you must need Your internet Data connection for them to work on Digital Clock with Vue.js
.

index.html

This is the main HTML view of our Simple Web Application. In here, we have init Base declared all our simple my this Example(Digital Clock with Vue.js) dependencies and the HTML Elements that we have created.

<div id="liveclck">
    <p class="date">{{ date }}</p>
    <p class="pakatime">{{ pakatime }}</p>
    <p class="text">Simple DIGITAL CLOCK with Vue.js</p>
</div>

index.js

This data contains our simple custom index.js files Add Like as javascript, vuejs scripts

var liveclck = new Vue({
    el: '#liveclck',
    data: {
        pakatime: '',
        date: ''
    }
});

var custom_date = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
var timerID = setInterval(activeUpdateDateTime, 1000);
activeUpdateDateTime();
function activeUpdateDateTime() {
    var mycurrentDate = new Date();
    liveclck.pakatime = sysPaddingZro(mycurrentDate.getHours(), 2) + ':' + sysPaddingZro(mycurrentDate.getMinutes(), 2) + ':' + sysPaddingZro(mycurrentDate.getSeconds(), 2);
    liveclck.date = sysPaddingZro(mycurrentDate.getFullYear(), 4) + '-' + sysPaddingZro(mycurrentDate.getMonth()+1, 2) + '-' + sysPaddingZro(mycurrentDate.getDate(), 2) + ' ' + custom_date[mycurrentDate.getDay()];
};

function sysPaddingZro(lnum, mydgt) {
    var clckzro = '';
    for(var i = 0; i < mydgt; i++) {
        clckzro += '0';
    }
    return (clckzro + lnum).slice(-mydgt);
}

style.css

Last step, we have add the Following CSS styles for our simple Digital Clock with Vue.js and our Custom styling.

html,body {
    height: 100%;
}
body {
    background: #0f3854;
    background: radial-gradient(ellipse at center,  #0a2e38  0%, #000000 70%);
    background-size: 100%;
}
p {
    margin: 0;
    padding: 0;
}
#liveclck {
    font-family: 'Share Tech Mono', monospace;
    color: #3d3d3d;
    text-align: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #c60000;
    text-shadow: 0 0 20px rgba(10, 175, 230, 1),  0 0 20px rgba(10, 175, 230, 0);
    .pakatime {
        letter-spacing: 0.05em;
        font-size: 80px;
        padding: 6px 0;
    }
    .date {
        letter-spacing: 0.1em;
        font-size: 28px;
    }
    .text {
        letter-spacing: 0.1em;
        font-size: 13px;
        padding: 21px 0 0;
    }
}

Digital Clock with Vue.js

We hope you get an idea about Simple Digital Clock with Date using VueJS
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.