codeplumber liked a comment+100 XP
4w ago
@isimmons We could also have the alpine's @click.away="$dispatch('search:clear-results')"
codeplumber liked a comment+100 XP
1mo ago
@codeplumber, I agree that it reads better, but be aware of potential performance issues down the line.
Doing a GROUP BY like in the video delegates counting to the DB. This is something that DBs do all the time and is already fairly optimized. In this case, PHP receives already prepared counts for each of the categories.
Doing an ideas()->get()->countBy('status') will:
- Select rows from the database;
- Pass all of these rows from the DB to PHP;
- Load them as Eloquent models (the reason we have all of these different helper methods available); and
- Iterate over all of these Eloquent objects to get the count.
This is fine for a tutorial project, but it won't scale well down the line. While it would take 1000s of records to notice any real difference, I'd still suggest using the first approach. It's better to be safe than sorry.
codeplumber wrote a comment+100 XP
2mos ago
codeplumber wrote a comment+100 XP
2mos ago
@JeffreyWay You set the expectations too high for the rest of us, fixing bugs that fast! Thanks Jeffrey
codeplumber liked a comment+100 XP
2mos ago
codeplumber wrote a comment+100 XP
2mos ago
@mrrobotoh I have submitted a support ticket as it seems the issue is still here.
codeplumber wrote a comment+100 XP
3mos ago
codeplumber wrote a comment+100 XP
3mos ago
Color theme for those looking to copy:
--color-background: oklch(0.12 0 0);
--color-foreground: oklch(0.95 0 0);
--color-card: oklch(0.16 0 0);
--color-primary: oklch(0.65 0.15 160);
--color-primary-foreground: oklch(0.12 0 0);
--color-border: oklch(0.24 0 0);
--color-input: oklch(0.24 0 0);
--color-muted-foreground: oklch(0.6 0 0);
codeplumber wrote a comment+100 XP
3mos ago
codeplumber liked a comment+100 XP
3mos ago
One important thing when creating routes like that, is the order.
Route::get('/ideas/create', [IdeaController::class, 'index']);
Must be defined before
Route::get('/ideas/{idea}', [IdeaController::class, 'show']);
Or you will scratch your head as to why you get a 404 when trying to navigate to the create Idea route.
codeplumber wrote a comment+100 XP
3mos ago
@AdamBark These are just non-blocking deprecation warnings, likely because of the installer you're running has dependencies not yet ready for PHP 8.4 used in CLI. If you are bothered, update the installer in Herd and you should be good to go.
codeplumber wrote a comment+100 XP
3mos ago