codebykyle / calculated-field

A Server Side Calculated Field for Laravel Nova

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

calculated field on index

Dontorpedo opened this issue · comments

hello,

it would perfectly fit for my app, is it doable to use it on the indexpage?

thanks
D

Hello,
This field shows up on the index page but, at the moment, it just uses the display value. If you'd like to make a field calculate on the front end, there is a blog post attached to this repository, available here:

https://codebykyle.com/blog/laravel-nova-custom-calculated-field

This is a complete breakdown of how this field was made, with explanations. You should be able to make this work on the index field if you'd like.

You can follow blog post, but instead of editing the FormField.vue file, change the code over to the IndexField.vue. You will need to build an additional mechanism to save the changes you made from the index via an ajax call.

Let me know if this answers your question or if you're looking for something more specific.

Thanks,
-Kyle