AI-Gmz liked a comment+100 XP
1mo ago
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 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 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 liked a comment+100 XP
2mos ago
Here are the full CSS component files for those looking to copy:
resources/css/components/btn.css
button {
cursor: pointer;
}
.btn {
background: var(--color-primary);
border-radius: var(--radius-xl);
color: var(--color-primary-foreground);
padding-inline: calc(var(--spacing) * 3);
font-size: var(--text-sm);
font-weight: var(--font-weight-medium);
cursor: pointer;
height: calc(var(--spacing) * 8);
line-height: calc(var(--spacing) * 8);
display: inline-block;
}
.btn.btn-outlined {
background: transparent;
border: 1px solid var(--color-border);
border-color: var(--color-border);
color: var(--color-foreground);
}
.btn.btn-outlined:hover {
background: color-mix(in srgb, black 25%, var(--color-input));
}
.btn.btn-ghost {
background: transparent;
}
.btn:has(> svg) {
display: flex;
align-items: center;
column-gap: calc(var(--spacing) * 2);
}
.btn:hover {
background: color-mix(in srgb, black 10%, var(--color-primary));
text-decoration: none;
}
resources/css/components/form.css
label {
color: var(--color-foreground);
}
.input {
border-radius: var(--radius-md);
height: calc(var(--spacing) * 10);
width: 100%;
border-width: 1px;
border-color: var(--color-border);
padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
background-color: var(--color-card);
color: var(--color-foreground);
outline: 2px solid transparent;
outline-offset: 2px;
}
.input::placeholder {
color: var(--color-muted-foreground);
}
.input:focus-visible {
outline: 0;
box-shadow:
0 0 0 calc(var(--spacing) * .5) var(--color-background)
0 0 0 calc(var(--spacing) * 1) var(--color-primary);
}
@media (min-width: var(--breakpoint-md)) {
.input {
font-size: var(--text-sm);
}
}
.textarea {
border-radius: var(--radius-md);
height: calc(var(--spacing) * 40);
width: 100%;
border-width: 1px;
border-color: var(--color-border);
padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
background-color: var(--color-card);
color: var(--color-foreground);
outline: 2px solid transparent;
outline-offset: 2px;
}
.textarea::placeholder {
color: var(--color-muted-foreground);
}
.textarea:focus-visible {
outline: 0;
box-shadow:
0 0 0 calc(var(--spacing) * .5) var(--color-background)
0 0 0 calc(var(--spacing) * 1) var(--color-primary);
}
.label {
display: block;
font-size: var(--text-sm);
}
input[type=file] {
display: block;
width: 100%;
font-size: 0.875rem;
line-height: 1.25rem;
color: var(--color-foreground);
}
input[type=file]::file-selector-button {
margin-right: calc(var(--spacing) * 4);
padding: calc(var(--spacing) * 2) calc(var(--spacing) * 4);
border-radius: calc(var(--spacing) * 2);
border-width: 0;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;
background-color: var(--color-primary);
color: rgb(var(--color-background));
}
input[type=file]::file-selector-button:hover {
opacity: 0.9;
}
.error {
font-size: var(--text-sm);
color: var(--color-red-600);
}
.form-muted-icon {
color: var(--color-muted-foreground);
}
.form-muted-icon:hover {
color: var(--color-foreground);
}
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 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 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 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 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 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 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 liked a comment+100 XP
3mos ago
the link https://laravelfromscratch.com seems to be broken