示例#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' => '/']);
         }
     };
 }
示例#2
0
文件: View.php 项目: hernandes/mithos
 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]);
     }
 }