AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

1mo 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.

AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

1mo ago

It is possible to use in status-label @class directive:

@class([

'inline-block rounded-full border px-2 py-1 text-xs font-medium',

'bg-yellow-500/10 text-yellow-500 border-yellow-500/20' => $status === 'pending',

'bg-blue-500/10 text-blue-500 border-blue-500/20' => $status === 'in_progress',

'bg-primary/10 text-primary border-primary/20' => $status === 'completed',

])

AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

1mo ago

It's really interesting how I started this journey knowing very little about laravel but now instead of using $status === 'pending' and $status === 'completed' im thinking outside the box and tweaking it to use the enum values for future proofing. if ($status === IdeaStatus::PENDING->value) {} and importing the dependencies myself. Thanks for this :)

AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

2mos ago

CodeRabbit is a paid service, and deserves every penny. But for a more laravel-native and free alternative, I'd recommend laravel-simplifier. php-simplifier's laravel-first version, kinda.

I commit and before pushing, I call Claude to scan with laravel-simplifier. Almost 99% accurate and most times I accept without touching anything. Then I push.

https://laravel-news.com/laravel-gets-a-claude-code-simplifier-plugin

AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

2mos ago

Here are the full CSS component files for those looking to copy:

resources/css/components/btn.css

resources/css/components/form.css

AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

2mos 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);
AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

2mos ago

Heres a bit more information for those who want to know a little more like how to queue up jobs every hour. (I think this wasn't included for simplicity)

To queue up jobs to run hourly open routes/console.php and add the below:

use App\Jobs\UpdateIdeaStatistics; use Illuminate\Support\Facades\Schedule;

// Hourly means at 10:00, 11:00 etc etc not when it was started. Schedule::job(new UpdateIdeaStatistics)->hourly();

// You could also run for every minute etc etc, which I advise for testing and making sure you've setup everything correctly. Schedule::job(new UpdateIdeaStatistics)->everyMinute();

As with everything for queues this won't just magically work, though it is super simple.

In order for it to work, we need to deply a scheduer which is responsible for co-ordinating/scheduling the repeat jobs.

Open a new cli and type php artisan schedule:work this will setup your scheduler.

Make sure to deploy a worker too in another cli by running php artisan queue:work.

Check your log file after an hour, or a minute depending on which one you choose from the above options and you should see the log in there from the logger().

You will also see the below in your scheduler CLI (the one you ran php artisan schedule:work in):

INFO Running scheduled tasks.
INFO No scheduled commands are ready to run.
2026-02-01 19:36:00 Running [App\Jobs\UpdateIdeaStatistics] ... 18.08ms DONE 2026-02-01 19:37:00 Running [App\Jobs\UpdateIdeaStatistics] ... 15.33ms DONE INFO No scheduled commands are ready to run.

Super cool and super simple :)

AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

2mos ago

Hi @connor1231 ,

This is what is my cencept and I am open to discuss:

  • If we want to apply authorization rule to page level, we should use a gate and if we want to apply authorization rule to a model we should use policy.
  • As Jeffry had mentioned, gates are route closure equivalent of authorization and policies are controller equivalent of authorization for models.
  • If I do not want to display a page to an user, irrespective of whether the page is tied to any model or not, I will reach for gate. For example, an admin can view all ideas of all users. This page should be accessible by only admin.
  • If I want to restrict an user to update an idea created by another user, I will reach for policies. In this case, the update page is more specific to a model.

Regards, Anupam Bordoloi

AI-Gmz's avatar

AI-Gmz started a new conversation+100 XP

2mos ago

Hi Jeffrey and team, I think there is a critical UI bug affecting the lesson pages.

Up until a few minutes ago, I could see the written theoretical material, code blocks, and homework exercises below each video. However, after refreshing the page, that entire section has completely disappeared from every episode and every series on the site.

​Now, only the 'Transcript | Comments | Ask AI' tabs are visible. The written content is vital as it contains details and exercises not found in the videos. Is this a bug related to a new update?

Please look into this, as it's affecting the learning experience for all courses.

​Thanks for your hard work!"

AI-Gmz's avatar

AI-Gmz wrote a comment+100 XP

2mos ago

Is anyone else missing the lesson notes and homework? Just a few minutes ago, they were visible, but after a refresh, the whole section is gone from every single episode on the site.

It seems the layout has changed to only show 'Transcript', 'Comments', and 'Ask AI'. This is quite a loss since the written content included code and tasks that aren't always in the video. Does anyone know if this is a bug or a new UI update?

AI-Gmz's avatar

AI-Gmz wrote a comment+100 XP

2mos ago

Subject: The "Lesson Notes" section has disappeared from all series

Hi Laracasts team! I think there might be a bug with the site layout. Until a few minutes ago, I could see the written material, code snippets, and homework exercises below the videos.

However, after refreshing the page, that entire section has vanished across all series, not just this one. Now I only see the 'Transcript | Comments | Ask AI' tabs. Those written guides and exercises are essential for my learning process. Is this a temporary glitch or a permanent change? Please bring them back!

AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

2mos ago

Warning:

If it seems like there are no ideas stored in session at 15:00, it might be happening because you tried to register the GET route like this:

Route::view('/', 'idea', [
    'ideas' => session('ideas', []),
]);

Instead, use the approach from the video and register the route under Route::get()


Brief explanation:

Route::view is trying to be efficient, so it loads its arguments only once at the very beginning.

From then on, whenever we try to access the route again, Route::view will always use the original session value instead of the updated one.

If you tried to render the session variable inside the blade view, you would always see the default value - in this case, an empty array, because that's what was set at:

'ideas' => session('ideas', []),


As Jeffrey mentioned in an earlier lesson (4), Route::view is meant for simpler, mostly static pages. Loading pages this way is more efficient, but it has downsides, as you can see in this example.

AI-Gmz's avatar

AI-Gmz wrote a comment+100 XP

3mos ago

@acandael Is the Spanish league even playing? XD

AI-Gmz's avatar

AI-Gmz liked a comment+100 XP

3mos ago

the link https://laravelfromscratch.com seems to be broken