Skip to content
Advertisement

Tag: accessor

How to call Laravel Model function with parameter into Vuejs (for calculating stock Qunatity)?

I have three model 1.Fertilizer, 2. Fertilizer Stock, 3.Fertilizer Sale. 2 & 3 have foreign key relation(fertilizer_id) & mysql quantity column . I want to calculate individual Fertilizer stock quantity in my fertilizer model and append with fertilizerController in inertia index page. What’s Wrong with my code? Controller Model Stock Function Answer Add this on your Fertilizer Model.

Advertisement