Category: Laravel, Laravel, PHP, PHP

Here is a simple tutorial to do the structure needed in the component of Ant Design TreeSelect (https://ant.design/components/tree-select/) with PHP. First of all, we would create the class Directory with a few attributes

I use Storage::directories from Laravel Facades, but also, you can use another implementation for list the directories given a path. In Laravel, this is maked with Finder Once you create both classes, you can initialize the Formatter with the path that you are interested to list and then call the method listDirectories().
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners