public function getInterfaceLocale()
 {
     $locale = Input::get("l");
     $translating = Input::get("t");
     $primary = Input::get("p");
     $displayLocales = Input::get("d");
     $display = implode(',', $displayLocales ?: []);
     App::setLocale($locale);
     Cookie::queue($this->cookieName(self::COOKIE_LANG_LOCALE), $locale, 60 * 24 * 365 * 1);
     Cookie::queue($this->cookieName(self::COOKIE_TRANS_LOCALE), $translating, 60 * 24 * 365 * 1);
     Cookie::queue($this->cookieName(self::COOKIE_PRIM_LOCALE), $primary, 60 * 24 * 365 * 1);
     Cookie::queue($this->cookieName(self::COOKIE_DISP_LOCALES), $display, 60 * 24 * 365 * 1);
     if (App::runningUnitTests()) {
         return Redirect::to('/');
     }
     return !is_null(Request::header('referer')) ? Redirect::back() : Redirect::to('/');
 }
Exemple #2
0
 private function resetDatabase()
 {
     $env = App::environment();
     $this->output->writeln("Truncating tables in {$env} environment");
     if (App::isLocal()) {
         foreach ($this->tables as $table) {
             $this->output->writeln("Truncating {$table}");
             DB::statement('TRUNCATE TABLE ' . $table . ' CASCADE;');
         }
     } elseif (App::runningUnitTests()) {
         Eloquent::unguard();
         foreach ($this->tables as $table) {
             $this->output->writeln("Truncating {$table}");
             DB::statement('TRUNCATE TABLE ' . $table . ' CASCADE;');
         }
     }
 }