schema = Schema::connection( config('eloquent-viewable.models.view.connection') ); $this->table = config('eloquent-viewable.models.view.table_name'); } /** * Run the migrations. * * @return void */ public function up() { $this->schema->create($this->table, function (Blueprint $table) { $table->bigIncrements('id'); $table->morphs('viewable'); $table->text('visitor')->nullable(); $table->string('collection')->nullable(); $table->timestamp('viewed_at')->useCurrent(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists($this->table); } }