Beispiel #1
0
 public function render($delimiter = ' | ')
 {
     if (App::isLocal() || !$this->_local_only) {
         $credential_links = [];
         foreach ($this->_link_data as $link_values) {
             $label = $link_values['label'];
             $js_code = $this->js_code($link_values['credentials']);
             $credential_links[] = '<a href="#" onclick="' . $js_code . '">' . $label . '</a>';
         }
         return implode($delimiter, $credential_links);
     }
     return '';
 }
Beispiel #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;');
         }
     }
 }
 public function __construct()
 {
     if (!App::isLocal()) {
         throw new Exception('DO NOT SEED IN PRODUCTION');
     }
 }