/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $container = Container::findOrFail($id); $data = ['name' => $container->name]; $cats = []; $categories = Container::find($id)->categories()->orderBy('name')->get(); foreach ($categories as $category) { $items = $category->items; //// add category name to returned item foreach ($items as $i => $item) { $itemArray = $item->toArray(); $itemArray['category'] = $item->category->name; $items[$i] = $itemArray; } $cats[] = ['name' => $category->name, 'items' => $items]; } $data['categories'] = $cats; return $data; }
public static function getUser() { $result = Container::user()->orderBy('name', 'ASC')->get(); return $result; }
public function createApplication($applicationName) { $config = new Config(new XmlReader(), new DiConverter()); $container = new Container($config); return $container->create($applicationName); }
/** * @param $name * @return object */ public function create($name) { return $this->container->create($name); }