1. Go to this page and download the library: Download iyogesharma/multi-db library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use YS\MultiDB\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create(static::$schema.'.clients', function (Blueprint $table) {
$table->id();
$table->string('code');
$table->string('name');
$table->string('created_by');
$table->string('modified_by')->nullable();
$table->boolean('active')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('clients');
}
};