Quick and Easy Nested Categories in Laravel

preview_player
Показать описание

Official site

Twitter

To solve a potentially unlimited amount of nested items like categories, you need more than recursive Eloquent relationships. Let's figure out how to easily build a tree of items with a single query, and use recursive Blade components to output the result.
Рекомендации по теме
Комментарии
Автор

I never thought of recursive components ! thank you

mogr
Автор

This is Laravel gold. Just bought a year subscription as a thank you. I'm sure he will come out with more resources. Almost every app I build has categories and sub categories and child. I had to make custom tables and restrict how nested they could get. This is a complete game changer. Literally will save my hours of work because i can reuse this same logic

alexlytle
Автор

u deserve more view sir!, what a great explanation. i was looking for the best solutions and practice to handle this case. thank you so much

BlackhatGamer
Автор

been struggling with this scenario for years, especially with ecommerce projects, never thought it would be that easy. thanks for sharing!

AmrSubZero
Автор

Great video - and great package! I vivedly remember writing recursive cte's ten years ago...

stefankrejci
Автор

Thanks for the video. Definitely subscribing to this channel and more. Whoever is made this video, deserves a bells. Top-notch!

kmaphane
Автор

super mentor and fantastic tutorial...well done man

amirkaftari
Автор

I really love your accent, your voice 😍 ❤ 💕
I hope you make a vue series 💖

Programming-Fun-With-Hima
Автор

We're gonna have to come up with a name for this child... Let's call it subchild.

I wasn't expect to laugh this hard to a laravel video 😂😂😂

kemal
Автор

getting error: Method does not exist. when im using tree()->get()->ofTree();

WintersTale-vzfm
Автор

Can we delete parent and child at same time ?

sirikorn.s
Автор

Great video but the bad thing on this tutorial that you used a package we will not learn how to do what the package is doing.

itcforyou
Автор

can I expect more laravel stuffs from you in future.

kuthub
Автор

can completed make crud using this library

robyortega
Автор

Lets say I have posts that have comments. So I have a posts table and comments table. The comments table contains all comments for all posts and is the table the adjacency relationships work on. But how can I create a link between the post ID and the comments for that post?

I assumed I could just make the parent_id field the id of the post *when the comment had no parent*. That is, the post ID would operate as the root of the comment tree since the post is indeed the root for it sown comments.

How have other solved this?

rosselliot
Автор

Isn't this recursive query too expensive?

alissonwell
Автор

I get error:
ErrorException
Undefined variable: category (View:

@props(['category'])
<div>
{{$category->name}} ({{$category->id}}) - it's shows me error on this line :(

stojankukrika