LaravelDaily / laravel-charts

Package to draw charts in Laravel with Chart.js
MIT License
532 stars 118 forks source link

Can we select certain records #122

Open drxabdulrahman opened 1 month ago

drxabdulrahman commented 1 month ago

Hi Mr, many thanx for this great package. can I apply a filter by certain field , example I want to show only records with certain type (according to type column in database) reported by date monthly . other types will not be shown

drxabdulrahman commented 1 month ago

I found a solution which I cannot its good or non-profissional one. I created another Model class in a subfolder - ex 'App/Models/Stats/User.php', and I put a global scope to this model and use it in chart

Eruvaer74 commented 3 weeks ago

Another solution would be to create a database view with all the necessary data. Then you create a dummy model which references to this view. This is the model you're using for the charts.