/** * Get fresh schema. * * @param string $locale * * @return array */ public function fresh($locale = null) { $currentLocale = $this->lang->getLocale(); if ($locale !== null) { $this->lang->setLocale($locale); } $data = array_map(function (BaseForm $item) { return $item->toArray(); }, $this->entities->resolveAll()); if ($locale !== null) { $this->lang->setLocale($currentLocale); } return $data; }
/** * @return array */ public function data() { return ['locale' => config('app.locale', 'en'), 'brandName' => $this->lang->tryTranslate(config('cruddy.brand', 'Cruddy')), 'uri' => config('cruddy.uri', 'backend'), 'entities' => $this->entities->available(), 'lang' => $this->lang->ui(), 'permissions' => $this->permissions()]; }