Commit for this lesson: https://github.com/LaravelDaily/Laravel-9-Beginners-Admin/commit/2edfa4265eb0bca80ebc8076b51beef247b477f4
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,
In this case, returned data is actually a web page, not sure what data exactly you want to check? Give more details please.
I mean by data the array of categories that we passed to the view. Thanks;
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.Ok, thank you.
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.
Well noted, thanks!