Haleem Hosein liked a comment+100 XP
1mo ago
Hello Jeremy, Just some quick feedback. I gotta say, I love this "vanilla" way of simply writing code to pass on ideas and concepts. Without interference from auto completion tools while listening to and watching you in action, this makes so much easier to assimilate it all.
While you probably should've extracted functionalities to services and used Livewire, It is just as nice to watch it being built like that 😄 thanks so much for this great series!
Haleem Hosein wrote a comment+100 XP
1mo ago
Thanks for another fantastic series!
Haleem Hosein liked a comment+100 XP
2mos ago
Repeater\TableColumn::make('Title')->markAsRequired() instead of adding * manually
Haleem Hosein liked a comment+100 XP
2mos ago
@sebkay No kidding haha. Normally, I'd work on something else...but when recording, you just have to wait it out.
Haleem Hosein liked a comment+100 XP
2mos ago
I’m looking forward to the rest of this series just to see what you do while Claude is working 😂
Haleem Hosein liked a comment+100 XP
3mos ago
** Warning **
Do not just use ->markdown() on its own this is prome to XSS (Cross-Site-Scripting) if you was to put <img src="#" onmouseover="alert('hacked');" /> in your idea description or worse a user was, when they hover over the image, an alert will show. Instead use:
`return Attribute::get(
fn ($value, $attributes) => new HtmlString(str($attributes['description'])->markdown([
'html_input' => 'escape',
'allow_unsafe_links' => false,
'max_nesting_level' => 5,
])));`
Haleem Hosein liked a comment+100 XP
3mos ago
For verifying that the request status exists in the IdeaStatus enum, PHP has a nice built in method that Claude Code showed me:
$status = IdeaStatus::tryFrom($request->status ?? '');
It will return the value if it exists or null otherwise.
Haleem Hosein liked a comment+100 XP
3mos ago
As much as I like to practice array mapping and manipulation, countBy() helps to clean the logic up a bit:
// Get counts in the controller
'counts' => $request->user()->ideas()->get()->countBy('status');
// Get counts in view, including those with no records
{{ $counts[$ideaStatus->value] ?? 0 }}
Haleem Hosein liked a comment+100 XP
4mos 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.
Haleem Hosein liked a comment+100 XP
4mos ago
Love the way you structure your lessons. Speedrun some bits, explain each step of the way. Really good stuff!
Oh and I am 100% guilty of doing the "it didn't work, try again" and adding layers of slop to my vibes 🤣
Taking good notes!
Haleem Hosein liked a comment+100 XP
4mos ago
First <3
@Jeffrey Way can you release a series on how to deploy a Laravel app with Docker in 2026 (maybe FrankenPHP)?
Haleem Hosein liked a comment+100 XP
4mos ago
Amazing feature! Thanks Caleb ❤️
Haleem Hosein liked a comment+100 XP
5mos ago
Quick note! At 13:07, we use the Bot's chat id to compare it to the authorized user id. Technically, this works for a private chat with the Bot. However, we should handle the possibility of group chats and channels by instead fetching the user directly. It's more clear that way, anyhow.
Use $bot->user()->id instead of $bot->chat()->id.
if ($bot->user()->id !== config('nutgram.authorized_user') {
$bot->sendMessage('You are not authorized to use this bot.');
}