Exemple #1
0
 /**
  * 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;
 }
Exemple #2
0
 /**
  * Get permissions for every entity.
  *
  * @return array
  */
 public function permissions()
 {
     $data = [];
     foreach ($this->entities->resolveAll() as $entity) {
         $data[$entity->getId()] = $entity->getPermissions();
     }
     return $data;
 }