예제 #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]);
     }
 }