Skip to main content

Manage Categories CRUD: Table, Edit, Create, Delete

Lesson 11/15 15:28
Autoplay

Comments & Discussion

O
Omar ✓ Link copied!

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,

PK
Povilas Korop ✓ Link copied!

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

O
Omar ✓ Link copied!

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

PK
Povilas Korop ✓ Link copied!

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.

O
Omar ✓ Link copied!

Ok, thank you.

S
selajdinbilali ✓ Link copied!

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.

PK
Povilas Korop ✓ Link copied!

Well noted, thanks!

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.