/** * Make a new instance of the entity to query on * * @param array $with */ public function make(array $with = array()) { return $this->model->with($with); }
public function getUserMenu() { /*Mendapatkan Menu user dari User yang diberikan */ $id = 1; $root = Model::with('children')->where('parent_id', 0); $menus = []; foreach ($root as $menu) { $menus[] = $menu->id; } return $menus; }