/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('languages', function ($table) {
         $table->engine = 'InnoDB';
         $table->charset = 'utf8';
         $table->collation = 'utf8_unicode_ci';
         $table->increments('id');
         $table->string('name');
         $table->char(config('multilanguage.locale_key'), 2)->unique('idx_locale');
         $table->timestamps();
         $table->softDeletes();
     });
     $languageProvider = new LanguageProvider();
     $language = $languageProvider->findByLocale(config('multilanguage.locale'));
     if (!$language) {
         $languageProvider->create([config('multilanguage.locale_key') => config('multilanguage.locale'), 'name' => 'English']);
     }
 }
コード例 #2
0
ファイル: Manager.php プロジェクト: jooorooo/multi-language
 public function getProviderModel()
 {
     return $this->provider->createModel();
 }