Loading...

Blog

REST API route in Laravel redirect to login page

I have built the REST api for my Vue.js application and I have used the Laravel Passport authentication to authenticate the API end point I have the following code snippet in my routes/api.php file. It basically return array of post when I call the URL http://localhost/api/posts provides that you have correct authentication. I am calling […]

Read more

Select Box binding in Vue

In this example we will see how we can bind the Select Box to Vue You can have the following Vue instance

Here, you will have the days array and selectedday to hold the value selected from the select box Now your HTML code should look as below

In this HTML code you […]

Read more

Check box binding in Vue js

In this lesson we will see how to bind check box in Vue when you build interface. We will see how to create product category and bind them to check boxes. Also we will see how to set the default category. First we will create the category array inside the data segment of the Vue […]

Read more

Vue Event Bus to communicate sibling components

90 total views, no views today

90 total views, no views today

Read more

Building Pagination with Vue and Laravel

Read more

How get query parameter in Vue

If you have url something like this htttp://mysite.com/products?page=2#vendor/2 how do you get the vendor id You can use the following code $this.route.params.id

Read more

Laravel API Resource for API end point

I need to get the Json objects when I call the Get request http://myapp.com/api/products API end point First thing you have do is create the normal controller using following artisan command

And create the Product model too Then you create the resource controller at App\Http\Resources location

Which will produce thw folllwong code

[…]

Read more

Pass parameter from child component to parent in Vue

When you work with Vue.js components you will have to pass paramets from child components to parant through events We have the following Vue component

You have text field with v-model=’fname’ Button has the click event and I am going to pass the fname to the function parentfunc in parent element This is the […]

Read more

Child to Parent communication in Vue

First we will create the component name child which will have ta button with click event

Name of the above compoment is child You have button inside the child element and it has @click=”$emit(‘parentfunc’)” which is used to call the funcation name parentfunc in the parent element of this child component We will just […]

Read more

Load JSON data with vue-resource in Vue.js

In this example we will see how we can load the JSON data to Vue using vue-resource. You can use the following HTML template to start

Now you can write the vue code under script section

Add the follwing code the inside the div element of the HTML code

Read more