Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Comments & Discussion

SP
Sylvain P ✓ Link copied!

thank you for this page

FM
Francis Makumi ✓ Link copied!

The add category button does not show modal on click in laravel 10.

PK
Povilas Korop ✓ Link copied!

Are there any errors in your browser console? No one else reported such bug.

FM
Francis Makumi ✓ Link copied!

There no errors on the browser console

N
Nerijus ✓ Link copied!

Also need repo to see your code

M
Márlon ✓ Link copied!

Sorry for the necro... I got same problem with Livewire: Multiple root elements detected.

The problem is that the modal's div was outside the main div, after moving it inside, everything worked as expected.

PS. I am using laravel 10

N
Nerijus ✓ Link copied!

Its just how livewire works.

M
muuucho ✓ Link copied!

PS Don't forget to have a cmd with "npm run dev" running if you are on Laravel 10. That was the problem for me with the modal not showing.

M
muuucho ✓ Link copied!

About postions: One should create the postions in numerical order, else moving a post with drag and drop won't work properly. So, move the creation of categories from the Categoryseeder (delete it) into the Databaseseeder:

$position = 1;
while ($position < 13){
		Category::factory()->create(['position' => $position,]);
		$position ++;
}
IC
Ikaro Campos Laborda ✓ Link copied!

livewire.js?id=a27c4ca2:347 Uncaught TypeError: Cannot read properties of null (reading 'name') at livewire.js?id=a27c4ca2:347:19 at Array.reduce (

It seems that in the latest version of Livewire, the binding category.name is not working as it works in this course. struggling to find a solution.

N
Nerijus ✓ Link copied!

Its because you are using the old syntax. Properties can't be binded to model directly

IC
Ikaro Campos Laborda ✓ Link copied!

How do I fix that?

N
Nerijus ✓ Link copied!

Read the docs. You can enable the old syntax but it is not recommended. This course was made when v3 wasn't released.