lara_dev_1970 wrote a comment+100 XP
3d ago
We'll see how the rest of the course develops, but right now I don't understand the logic of this point, because right now what's being passed is static data.
lara_dev_1970 wrote a comment+100 XP
4d ago
Otherwise, without knowing what will happen to the code later on.
/* resources/views/components/layout.blade.php */
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="dark" />
@vite(['resources/css/app.css', 'resources/js/app.js'])
<title>{{ 'WorkLarcast - '. $title ?? '' }}</title>
</head>
<body class="bg-pixl-dark text-pixl-light flex gap-8 px-4 sm:h-dvh sm:overflow-clip xl:gap-16">
@php
/* Define an array of routes where the Post button should be shown */
$array = ['profile', 'otherPage', 'anotherPage'];
/* Check if current route is in the array to return true or false */
$showPostButton = collect($array)->contains(
fn ($route) => request()->is($route)
);
@endphp
<!-- Navigation -->
<x-partials.navigation :showPostButton="$showPostButton" />
{{-- Main content --}}
{{ $slot }}
<!-- Sidebar -->
<x-partials.aside />
</body>
</html>
/* resources/views/profile.blade.php (for example)
At this point you don`t need @props([ ]) to pass variables
*/
<x-layout title="Profile page">
<!-- Start Content -->
<!-- End Content -->
</x-layout>
lara_dev_1970 wrote a comment+100 XP
4d ago
@ageorge28 I think theme is One Dark Pro
lara_dev_1970 wrote a comment+100 XP
4d ago
Notes and personal opinions
✱ Code
✱ When you are coding in laravel with componentes you can pass data an varibles directly, like this:
<x-cart.product :cart="$cart" :product="$product" :any_variable="$any_variable" />
This way, you don't need to put into component:
@props([
"product",
"cart",
"any_varibale",
])
✱ CSS
Buttons looks better with hand cursor:
class="cursor-pointer"
GitHub Code:
Laracast Github - Frontend Mentor Challenge with Laravel
Simon Vrachliotis Githb - Frontend Mentor Challenge with Laravel
It would be very good if they explained the development on more than one platform, and above all on generic ones, like shared hosting with Cpanel... etc.
lara_dev_1970 liked a comment+100 XP
4d ago
@Niush No it's not. Tailwind uses 'cursor: default' for buttons as a default. Even says so in the documentation you linked to 😉
lara_dev_1970 liked a comment+100 XP
4d ago
Nice series!
You forgot cursor-pointer on the buttons ;)
lara_dev_1970 liked a comment+100 XP
5d ago
This is a very good time to point out that the subtract and add items buttons need accessibility. You can add a title to the svgs <title>Substract Item</title> or add an aria title to the button. Something to remember on the remove item in the checkout section as well.
Yes it's a bit pedantic in a lesson like this but I find it's one of those things that can get missed if you're not on top of it all that time :)
lara_dev_1970 wrote a comment+100 XP
5d ago
This returns Call to a member function totalQuantity() on null. when there are not session into table cars.
To solve: cart/index.php
Your Cart ({{ $cart?->totalQuantity() ?? 0 }})
@if($cart)
<aside class="relative p-6 h-full">
<h2 class="text-red font-bold text-2xl inline-flex">Your Cart (<span>{{ $cart?->totalQuantity()??0}}</span>)
</h2>
@if($cart?->totalQuantity())
<x-cart.active :cart="$cart"/>
@else
<x-cart.empty/>
@endif
</aside>
lara_dev_1970 wrote a comment+100 XP
6d ago
create_productos_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('category');
$table->string('image');
$table->unsignedInteger('price_cents');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('products');
}
};
lara_dev_1970 wrote a comment+100 XP
6d ago
ProductSeeder.php
<?php
namespace Database\Seeders;
use App\Models\Product;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\File;
class ProductSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$data = json_decode(File::get(database_path('seeders/data.json')));
foreach ($data as $product) {
Product::create([
'name' => $product->name,
'category' => $product->category,
'image' => str_replace('./assets/images/', '', $product->image->mobile),
'price_cents' => $product->price * 100,
]);
}
}
}
lara_dev_1970 wrote a comment+100 XP
1w ago
@jdworks yes, and Webstorm too. But if you see the terminal messages you can read:
Files in the public directory are served at the root path.
Instead of /public/fonts/DepartureMono-Regular.woff2, use /fonts/DepartureMono-Regular.woff2.
lara_dev_1970 wrote a comment+100 XP
1w ago
We all know the quality of Jeffrey's courses, but this one certainly falls short of standards. It's unacceptable that Jeffrey's face takes up as much screen space as the code editor itself, especially considering the lack of essential line numbering (and no Soft-Wrap), the absence of a reference to the current file, and the lack of a Git repository. The screen changes so quickly after writing code that you don't even realize you've finished, and the same goes for imports. It seems this is a demonstration of how quickly the instructor uses the IDE, and that the student's learning isn't the priority.
Lessons like this are incredibly frustrating, especially for non-native English speakers.
lara_dev_1970 liked a comment+100 XP
1w ago
I don’t like this lesson. It’s difficult, but not because the topic itself is complex — it’s because there are many errors in the code. As a student, I run into these issues and initially assume that I’ve misunderstood something. But after spending several hours debugging, making two attempts, and carefully watching the video to the end, I realized that the same issues exist in Jeffrey’s code — he’s just not as thorough with testing as I am.
This really slows me down and makes it harder to absorb the material. What’s especially frustrating is that this lesson contrasts sharply with the rest of Jeffrey’s courses, which are usually clear and well-explained.
lara_dev_1970 liked a comment+100 XP
1w ago
Everything fails, even following lesson second to second!
lara_dev_1970 liked a comment+100 XP
1w ago
This is pretty disappointing for being part of a paid Laravel course to be honest.
Obviously frontend stuff is unavoidable and I appreciate the initial intention behind bringing AlpineJS in, but it has led to this, an entire episode of refactoring ugly rushed inline Javascript inside quotes with no linting or syntax highlighting, in a tutorial that's supposed to be about a full-stack PHP framework.
When you're teaching PHP & Laravel, you're amazing. But the next time you re-do this course, please do better on the frontend.
lara_dev_1970 liked a comment+100 XP
1w ago
I wish I knew the file Jeffrey is working on, without that or the source code it's somewhat hard to follow along
lara_dev_1970 liked a comment+100 XP
1w ago
Indeed a very complex lecture, in my opinion due to the nature that most stuff is specific to "alpine.js". Apart from that it would really help a lot to use an IDE/editor where the filename is permanently visible.
lara_dev_1970 wrote a comment+100 XP
1w ago
Authorization Policies & Group Routes
Group all with middleware and group routes policies whit "can"
Route::middleware('auth')->group(function () {
Route::get('/ideas', [IdeaController::class, 'index'])->name('ideas.index');
Route::post('/ideas/store', [IdeaController::class, 'store'])->name('ideas.store');
Route::can('work-with','idea')->group(function () {
Route::get('/ideas/{idea}', [IdeaController::class, 'show'])->name('ideas.show');
Route::post('/ideas/{idea}', [IdeaController::class, 'destroy'])->name('ideas.destroy');
Route::get('/ideas/{idea}/edit', [IdeaController::class, 'edit'])->name('ideas.edit');
Route::post('/ideas/{idea}/update', [IdeaController::class, 'update'])->name('ideas.update');
Route::patch('/steps/{step}', [StepController::class, 'update'])->name('step.upddate');
});
/* *** SessionController *** */
Route::post('/logout', [SessionsController::class, 'destroy'])->name('logout');
});
lara_dev_1970 wrote a comment+100 XP
1w ago
Changes in this tag
1️⃣ Create file resources/views/components/form/repeater.blade.php
2️⃣ Replace Code in resources/views/idea/index.blade.php
3️⃣ Better Image Upload showing image before upload
✅ Git Repo For This Lesson

lara_dev_1970 wrote a comment+100 XP
1w ago
✅ Repo this lesson in GitLab
( with some variants ) 👉🏻 Here
lara_dev_1970 wrote a comment+100 XP
1w ago
✅ Repo in GitLab
( with some variants ) 👉🏻 Here
lara_dev_1970 wrote a comment+100 XP
1w ago
Repo in GitLab (* with some variants ) 👉🏻 Here
lara_dev_1970 wrote a comment+100 XP
1w ago
Repo in GitLab (* with some variants ) 👉🏻 Here
lara_dev_1970 wrote a comment+100 XP
1w ago
Repo (with some variants) 👉🏻 Click HERE
⭐ Button filters with IdeaStatus enum colors when activate.
⭐ Button filters with x when is active.
⭐ Button filters remove filter when second click .
⭐ Blade Heroicons Install.
⭐ DebugBar Install.
lara_dev_1970 liked a comment+100 XP
1w 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.
lara_dev_1970 wrote a comment+100 XP
2w ago
lara_dev_1970 wrote a comment+100 XP
2w ago
Another version
File app/IdeaStatus.php
<?php
declare(strict_types=1);
namespace App;
enum IdeaStatus: string
{
case PENDING = 'pending';
case IN_PROGRESS = 'in_progress';
case COMPLETED = 'completed';
public function label(): string
{
return match ($this) {
self::PENDING => 'Pending',
self::IN_PROGRESS => 'In Progress',
self::COMPLETED => 'Completed',
};
}
public function colors():string
{
return match ($this) {
self::PENDING => 'text-yellow-500 bg-yellow-500/10 border-yellow-500/20',
self::IN_PROGRESS => 'text-orange-500 bg-orange-500/10 border-orange-500/20',
self::COMPLETED => 'text-green-500 bg-green-500/10 border-green-500/20',
};
}
}
File resources/views/components/ide/status-label.blade.php \
<span @class(["inline-block text-xs rounded-full border mt-2 px-2 p-y-1 text-sx font-medium",
$status->colors(),
])>
{{ $status->label() }}
</span>
//File resources/views/components/card.blade.php \
<a href="{{route('ideas.show', $idea->id)}}" {{ $attributes(['class'=>'border border-border rounded-lg bg-card p-4 md:text-sm'])}} >
<h3 class="text-foreground text-lg">{{$idea->title}}</h3>
<x-idea.status-label :status="$idea->status" />
<div class="mt-5 line-clamp-3">{{ $idea->description }}</div>
<div class="mt-4">{{ $idea->created_at->diffForHumans() }}</div>
</a>
File resources/views/idea/index.blade.php
<x-layout>
<div class="text-muted-foreground">
<header class="py-8 md:py-12">
<h1 class="text-3xl font-bold">Ideas</h1>
<p class="text-muted-foreground text-sm mt-2"> Capture yor thoughts. Make a plan.</p>
</header>
<div class="mt-10">
<div class="grid md:grid-cols-2 gap-6">
@forelse($ideas as $idea)
<x-card :idea="$idea"/>
@empty
<h2 class="text-4xl font-bold text-purple-600 ">No ideas at this time</h2>
@endforelse
</div>
</div>
</div>
</x-layout>
lara_dev_1970 wrote a comment+100 XP
2w ago
@RJdie27
In phpStorm check Settings->Tools->Web Browsers and Preview.
Into the section Reload behavior make sure that On Save is selected
lara_dev_1970 wrote a comment+100 XP
2w ago
lara_dev_1970 wrote a comment+100 XP
2w ago
Git for this lesson in Githlab: https://gitlab.com/JuanJota/idea/-/tags/DesignYourModelLayer
lara_dev_1970 liked a comment+100 XP
2w ago
The audio translation is NOT synchronized with the video. ☹️
Very good course. 👏
lara_dev_1970 liked a comment+100 XP
2w ago
@Bulat Auth::id() worked for me
lara_dev_1970 liked a comment+100 XP
2w ago
@jeffreyway Random question: do you have a plugin installed for your editor that creates the clickable links in the terminal?
lara_dev_1970 wrote a comment+100 XP
2w ago
@priya_N_E Everything that is found between the tags will be captured by the slot variable, you don't need to declare it. This is so because that is how Laravel is programmed.
lara_dev_1970 wrote a comment+100 XP
3w ago
@lara_dev_1970 Solution: Add:
->decimalPlaces(0)
Slider::make('priority')
->required()
->minValue(1)
->maxValue(10)
->pips(Slider\Enums\PipsMode::Steps)
->decimalPlaces(0)
->step(1)
->fillTrack()
->tooltips()
->default(0),
lara_dev_1970 wrote a comment+100 XP
3w ago
Slider::make('priority')
->required()
->minValue(1)
->maxValue(10)
->pips(Slider\Enums\PipsMode::Steps)
->step(1)
->fillTrack()
->tooltips()
->default(0),
When the slider is in position 4 & 7 the tooltip shows 4.9999999999 or 6.99999999999