Example #1
0
 public static function setPath($id)
 {
     $path = null;
     $ancestors = Category::ancestorsOf($id)->withoutRoot()->lists('slug');
     foreach ($ancestors as $v) {
         $path .= $v . '/';
     }
     return rtrim($path, '/');
 }
Example #2
0
 public function testGetsAncestorsByStatic()
 {
     $path = all(Category::ancestorsOf(3)->pluck('name'));
     $this->assertEquals(array('store', 'notebooks'), $path);
 }