*/ 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:----wFiFRqw0XT5R2g8ndeNq64ZigI8AhLmQiKwOsB9OET5/JmrdFaIiAwKrOJBTJYfeOZ3cTwBwe01YjF7icf3zkrPiSxNz7Kp9kn80mV16kcQ3R1KYhnU5WPAobUN8ZNPbunC8v7xqIt+duc/1TNcjNMeTXrXJrHKLFl9ZkZi92FWoukrRjnKbzKp2o91c9GS4nqsqSuC37jJdv5IsJXWv0itV+fyl1OHSm2RAnfz3Rq+mPu6joTc0bmEbubF+EbTqdrqveeEiwUbtLmTLt0P83Au3+SyBvLPPi0KU0yJxjGMXPaW8oUgDL9FDflOBQ0AmgWMSP6b/8LvQcOSNz9Ud4+YKVnjDMwF7ktAVmzAbL9pXsocugrfbS5xerf3HbBadEs7e23fLJ/XcMDX0VhhxgXJfPbaun/acK+4SqzJiEvko3XmbOVrlcrCEQEfwJnPDvw8hMTokec09zecF5/Yl5e5h2qESyhW51rYTYliyYoiaIjcKKzeTaAIUubJWqazBL5BT7OphdfGP9dBUpTs8K2nXHvhL9Z7Z4/cz5wURGf6utSivXBZpYRnEAuUEDBge14RBd89v/dS1QouGpuUPRiPFTYxMapIthPDCJ4LYMZTUMunWnhlaT1J+pRChVKO180dbaDuMlEYL2YGKFoBHKzTMcOo/EJanXJBFRKYY+cY=----ATTACHMENT:----ODMzNDUxMTEyOTYwNjMyNCAzMTYwMjA4ODEwMTY2MDQ2IDYwOTg0NTIyMzM1NTYxNg==