Bijaya Prasad Kuikel
1 min readJan 31, 2019

Hello.

I have already worked on the issue you raised. My solution to your problem is described below:

In the UserResource.php file add new field:

'action' => ['view' => route('users.show', $this->id),
'edit' => route('users.edit', $this->id)
];

Now your api sends the link to view / edit the item.

Next inside data table component:

<tr v-for="(data, key1) in tableData" :key="data.id" class="m-datatable__row" v-else>         
<td>{{ serialNumber(key1) }}</td>
<td v-for="(value, key) in data">{{ value }}</td>
<td v-if="key==='action'>
<a :href="value.view">View</a>
<a :href="value.edit">View</a>
</td>
</tr>

This is not the exact code but you can try to get the desired result.

Hope this helps.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Bijaya Prasad Kuikel
Bijaya Prasad Kuikel