etrepat / baum

Baum is an implementation of the Nested Set pattern for Laravel's Eloquent ORM.
http://etrepat.com/baum
MIT License
2.24k stars 459 forks source link

make an array of string form nodes in Baum laravel package #293

Open ahmadbadpey opened 6 years ago

ahmadbadpey commented 6 years ago

I used Baum laravel package to create my Tag model.

Suppose I have this tree structure for tags:

Now I want to make an array of string like this from those :

    array[
      'tag 1',
      'tag 1 >> tag 1.1',
      'tag 1 >> tag 1.1 >> tag 1.1.1'
      'tag 2',
      'tag 2 >> tag 2.1',
      'tag 2 >> tag 2.1 >> tag 2.1.1'
    ]

Is there any way to create that ?