Skip to main content

Dashboard Widgets: Charts and Tables

Premium
5 min read

In this lesson, let's change our dashboard to something more interesting than static placeholders.

Typically, we have charts and numbers on the dashboard of such projects. So, we can calculate something like these:

  • Tasks completed vs in progress
  • Tasks due today
  • Tasks created this week, grouped by day

Let's show them all on the dashboard.


Change Factory and Re-Seed Data

To have some data to show, we need to randomize a few things and seed more tasks.

database/factories/TaskFactory.php:

return [
'name' => fake()->name(),
'is_completed' => fake()->boolean(),
'due_date' => fake()->dateTimeBetween('now', '+1 month'),
'created_at' => fake()->dateTimeBetween(now()->startOfWeek(), now()->endOfWeek()),
];

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Richard A. Hoyle avatar

Any chance of you helping us get the charts to actually work.?

I have two 2 due dates set for today; but I am not getting any on the Dashboard.

Modestas avatar

Could you add more details on what actually isn't working? It is working perfectly fine on my end :)

Richard A. Hoyle avatar

Every thing is working grate up to this point On the task/index.tsx page the file is visible as well as the Categories the Status is set for in Progress and the Due Date is set for todays date.

Modestas avatar

Check the database to see if they are set to in progress. Check that your database correctly filters the records based on the query.

Really hard to say what exactly is wrong here without seeing what was done.

I have just tested this - it does seem to work and correctly filter the due date results

Richard A. Hoyle avatar

the Progress Overview pie chart is working grate I went through and changed quite a few of the states to completed and the pie chart has changed as well

Richard A. Hoyle avatar

the program has the date as 3/21/2025 however the database has it as 3/22/2025 What’s up with this and how do I fix it?

this is both with the edit.tsx and the create.tsx files

If I chouse the date of 3/20/2025 then it shows up in the dashboard and the database has the date of 3/21/2025 but the Tasks index.tsx page has the date of the 3/20/2025 Not the 21 how can we fix this?

Povilas Korop avatar

Sorry but we can't "blindly" debug it for you.

Richard A. Hoyle avatar

I can zip it up and send it to you just give me a email and I will send it to you. My Email is rhoyle@comcast.net

Povilas Korop avatar

Sorry Richard but we're not going to spend time comparing your code manually when we provide the repository that you can copy paste in FULL and see if it works.

If we debug for everyone what happens on their local environment, we wouldn't have time to actually publish anything.

Ahmad Alharbi avatar

Thanks for the course , I have a question how to make the dashboard RTL ? sorry for the silly question but realy tried and did not make it , thank you in advance

Modestas avatar

Hello, I hqve never worked with RTL systems, so I am not sure how to help here

Riley Shannon avatar

Is Tailwind V4 still not supported? It appears that they have added it to the docs as a legacy just requiring Vue > 3.3. It appears they are using TW v4 in the docs with the @layer directive?

https://www.shadcn-vue.com/docs/charts.html

Modestas avatar

honestly - not sure

Carlos Bicho avatar

Clear, concise, and practical course that are highly useful for developers looking to enhance their Laravel skills. Their tutorials focus on real-world applications, making it easy to apply the concepts directly to projects.

FadiAbadir avatar

why Inertia vue resolves the page twice at first load

technoquo avatar

Great course as a foundation for building a CRUD app with Laravel, TypeScript and Vue. The core concepts are solid and well explained. Some parts are slightly outdated — for example, Ziggy has been replaced by Wayfinder in newer versions of the starter kit, and a few packages work differently — but nothing that can't be figured out with a bit of research. I also added vue-chartjs for dashboard charts and other extras. Overall a great starting point if you want to build a real Laravel + Vue + Inertia project. Thanks for the course! 🙌

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.