Example #1
0
 public static function printCategory($id)
 {
     $category = Category::find($id);
     if ($category != null) {
         echo "<ul>";
         echo "<li><a href='" . $category->id . "'>" . $category->name . "</a>";
         foreach (Category::where('category_id', $id)->where('active', true)->get() as $cat) {
             Category::printCategory($cat->id);
         }
         echo "</li>";
         echo "</ul>";
     }
 }