Пример #1
0
 protected function makeSource()
 {
     if (empty($this->source)) {
         $locale = $this->locale;
         $format = $this->format;
         $path = $this->path;
         $this->source = Source::create(compact('locale', 'format', 'path'));
     }
     return $this;
 }
Пример #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('sources')->delete();
     DB::table('strings')->delete();
     $source = ['locale' => 'en', 'format' => 'twine', 'path' => null];
     $source = Source::create($source);
     $strings = ['save' => 'Save', 'load' => 'Load', 'new' => 'New', 'open' => 'Open', 'close' => 'Close', 'ok' => 'OK', 'cancel' => 'Cancel', 'delete' => 'Delete'];
     foreach ($strings as $key => $value) {
         $string = ['key' => $key, 'uri' => 'basic.' . $key, 'value' => $value, 'locale' => 'en', 'source_id' => $source->id];
         $string = String::create($string);
     }
 }