0

I am working on a Laravel API project, and I am trying to build a dashboard with four simple reports. The reports get the data from different (already existing) models. So I was wondering where I should create the queries for those reports. Should I create a Dashboard Controller without a Model because I don't have a database table for the dashboard? Please advise me on the best practices for this specific case scenario. I want to keep the codebase clean, maintainable, and extensible.

Elisaveta
  • 39
  • 5

1 Answers1

0

For dashboard data ur gonna probably need relationships and other ways to get the data. What i most commonly do is make like HomeController, view and model and then upon user logging in that is default page and u display. I don't think doing it without model is gonna do you any better. With model at least u can clarify more clearly where is data coming from with ->relation than to use long code. Anyway, this subject is project specific so u need to determine what's best for you.

cile1993
  • 156
  • 10