Beispiel #1
0
 public static function requireAuth()
 {
     $instance = self::getInstance();
     return function () use($instance) {
         if (!Auth::loggedIn()) {
             error(__('Você deve estar logado para acessa está página.'), ['redirect' => '/']);
         }
     };
 }
Beispiel #2
0
 public function service($template, $root, $data = [])
 {
     $account = \Mithos\Account\Auth::getAccount();
     if ($account !== null) {
         $avaliables = Hash::nest($account->getAvaliableServices());
         $services = [];
         foreach ($avaliables as $avaliable) {
             if ($avaliable['service'] == $root) {
                 $services = $avaliable['children'];
             }
         }
         return View::display('panel/view', ['service' => View::fetch($template, array_merge(['layout' => false], $data)), 'account' => \Mithos\Account\Auth::getAccount(), 'services' => $services]);
     }
 }