Skip to main content

Manage Categories CRUD: Table, Edit, Create, Delete

Lesson 11/15 15:28
Autoplay
Omar avatar

I tried to check the data passed to the view in devtools but the response is a web page; Is there a way to check this returned data with devtools ? Thanks,

Povilas Korop avatar

In this case, returned data is actually a web page, not sure what data exactly you want to check? Give more details please.

👍 1
Omar avatar

I mean by data the array of categories that we passed to the view. Thanks;

Povilas Korop avatar

I usually do the dd($categories); before returning to the view. And there are other tools for debugging, like Spatie Ray, but it's not free.

👍 1
Omar avatar

Ok, thank you.

selajdinbilali avatar

Careful if you use the tables from part 2, when you try to delete a category thay will be a constrained error.

You can add :

$table->foreignId('category_id')->constrained()->onDelete('cascade')->onUpdate('cascade');

to your posts migration.

👍 1
Povilas Korop avatar

Well noted, thanks!