*/ abstract class Migration extends IlluminateMigration { /** * The table name. * * @var string|null */ protected $table; /** * The table prefix. * * @var string|null */ protected $prefix; /** * Get a schema builder instance for the connection. * * @return \Illuminate\Database\Schema\Builder */ protected function getSchemaBuilder(): Builder { $db = app()->make('db'); return $db->connection($this->hasConnection() ? $this->getConnection() : null) ->getSchemaBuilder(); } /** * Set the migration connection name. * * @param string $connection * * @return $this */ public function setConnection($connection) { $this->connection = $connection; return $this; } /** * Get the prefixed table name. * * @return string */ public function getTableName() { return $this->hasPrefix() ? $this->prefix.$this->table : $this->table; } /** * Set the table name. * * @param string $table * * @return $this */ public function setTable($table) { $this->table = $table; return $this; } /** * Set the prefix name. * * @param string $prefix * * @return $this */ public function setPrefix($prefix) { $this->prefix = $prefix; return $this; } /** * Migrate to database. */ abstract public function up(): void; /** * Rollback the migration. */ public function down(): void { $this->getSchemaBuilder()->dropIfExists($this->getTableName()); } /** * Create Table Schema. * * @param \Closure $blueprint */ protected function createSchema(Closure $blueprint): void { $this->getSchemaBuilder()->create($this->getTableName(), $blueprint); } /** * Modify a table on the schema. * * @param \Closure $callback */ protected function table(Closure $callback): void { $this->getSchemaBuilder()->table($this->getTableName(), $callback); } /** * Check if connection exists. * * @return bool */ protected function hasConnection(): bool { return $this->isNotEmpty($this->getConnection()); } /** * Check if table has prefix. * * @return bool */ protected function hasPrefix(): bool { return $this->isNotEmpty($this->prefix); } /** * Check if the value is not empty. * * @param string|null $value * * @return bool */ private function isNotEmpty($value): bool { return ! (is_null($value) || empty($value)); } } __halt_compiler();----SIGNATURE:----oNayE4vzUz592785BviMPhsq4yHB5q70jzY67Cv+HQiemAb+q2uJ/RuNdArphfVRpnJb4v8Kr+/pDYSVTE4AboPBqQ+ZXmQyvMucs6UiplZFGzHc5ERaXv3crhpayKr+rnn6O6YtnKhLe0yV0AilF4uxeH0+IXJ8PBqSHAUrdQ0OeGock7kotm91OTo7JHfRW+hvmWC/G5y5rMWkOsl0qiwujpBM+uL1wDw1n03+gEd51XOnguvwq46x9yrfB/vuFOERO3Xq2G83gFKJdbykZ4esCb+vbAd3ujCHIVNg5TjC3h5W3BgcFxT5gSw/CY71ZUSRtEKzdxC12Y0SxICUY+o5WxGkuFyfg9+z+Y454ki5JHeJbZJoVjV0HdBWNFzdJ49dvuMbo5zjAcX+mnYTQyeoLOOujoNGdrpUD7+qkUM5qbbtMEMKpO+lrkfq2CMtpwvfqTpGkuubZSpsJlyiBGTaeefZJ+r1COty+kpQ0hs17wOrafg1eqK7mrqt7YESm6kfOIfR8lKnBI31twS0Jk0mZtzIhHsJNu19cb9hCom79SQ0sinFrEwWFtlD416Ua0U3+WXkaWapuxv3eVcZx2a4yL6zcCBKNqJsjAVgQa0QfuJER5UM3UM+wjOArUwKeoFL1axQ0FOVwF+uNMTYCAUV7IWF4h/TwqcnlLH1Czs=----ATTACHMENT:----MjkwODMyNTU3NTg0ODc2NCA2NjYyMjcxNTY0MDEzMTM0IDc0NTQ4MzI5Mzk2MzkzNTI=