Sleimanx2\Plastic\Mappings\Mappings::createRepository PHP Method

createRepository() public method

Create the mapping repository data store.
public createRepository ( )
    public function createRepository()
    {
        $this->schema()->create($this->table, function ($table) {
            // The mappings table is responsible for keeping track of which of the
            // mappings have actually run for the application. We'll create the
            // table to hold the mapping file's path as well as the batch ID.
            $table->string('mapping');
            $table->integer('batch');
        });
    }

Usage Example

Example #1
0
 /**
  * Execute the console command.
  */
 public function handle()
 {
     $this->repository->setSource($this->option('database'));
     $this->repository->createRepository();
     $this->info('Mapping table created successfully');
 }