Skip to main content
Sylvain P avatar

thank you for this page

Francis Makumi avatar

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

Povilas Korop avatar

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

Francis Makumi avatar

There no errors on the browser console

Nerijus avatar

Also need repo to see your code

Márlon avatar

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

Nerijus avatar

Its just how livewire works.

muuucho avatar

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.

muuucho avatar

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 ++;
}
Ikaro Campos Laborda avatar
Ikaro Campos Laborda

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.

Nerijus avatar

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

Ikaro Campos Laborda avatar
Ikaro Campos Laborda

How do I fix that?

Nerijus avatar

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

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.