Estimated reading time: 1 minute

DB::__

 DB::connection($name=optional)
 DB::connection()->getDefaultConnection()
      ->setDefaultConnection()
      ->getPdo()
      ->getReadPdo()
      ->getConfig()
      ->getDriverName()
      ->getDatabaseName()
      ->getTablePrefix()
      ->getDoctrineConnection()
DB::table('')->select()
DB::raw()
DB::insert()
DB::update()
DB::delete()
DB::rollBack()
DB::commit()

queries

schema

Schema::connection('name')
Schema::create($table,$callback)
Schema::drop($table)
Schema::dropIfExists($table)
Schema::dropAllTables()
Schema::dropAllViews()
Schema::hasTable($table)
Schema::hasCoumn($table,$column)
Schema::hasCoumns($table,array $column)
Schema::hasCoumnType($table,$column)
Schema::getColumnListing($table,$column)
Schema::defaultStringLength(191)
Schema::rename($from,$to)

blueprint

composer require doctrine/dbal

  • install composer require doctrine/dbal for table any change

foreign

$table->foreign('user_id')
      ->references('id')->on('users')
      ->onDelete('cascade');