Schema.php 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Illuminate\Support\Facades;
  3. /**
  4. * @method static \Illuminate\Database\Schema\Builder create(string $table, \Closure $callback)
  5. * @method static \Illuminate\Database\Schema\Builder drop(string $table)
  6. * @method static \Illuminate\Database\Schema\Builder dropIfExists(string $table)
  7. * @method static \Illuminate\Database\Schema\Builder table(string $table, \Closure $callback)
  8. * @method static void defaultStringLength(int $length)
  9. *
  10. * @see \Illuminate\Database\Schema\Builder
  11. */
  12. class Schema extends Facade
  13. {
  14. /**
  15. * Get a schema builder instance for a connection.
  16. *
  17. * @param string $name
  18. * @return \Illuminate\Database\Schema\Builder
  19. */
  20. public static function connection($name)
  21. {
  22. return static::$app['db']->connection($name)->getSchemaBuilder();
  23. }
  24. /**
  25. * Get a schema builder instance for the default connection.
  26. *
  27. * @return \Illuminate\Database\Schema\Builder
  28. */
  29. protected static function getFacadeAccessor()
  30. {
  31. return static::$app['db']->connection()->getSchemaBuilder();
  32. }
  33. }