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()), ];
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.
Could you add more details on what actually isn't working? It is working perfectly fine on my end :)
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.
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
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
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?
Sorry but we can't "blindly" debug it for you.
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
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.