Schema.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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. *
  9. * @see \Illuminate\Database\Schema\Builder
  10. */
  11. class Schema extends Facade
  12. {
  13. /**
  14. * Get a schema builder instance for a connection.
  15. *
  16. * @param string $name
  17. * @return \Illuminate\Database\Schema\Builder
  18. */
  19. public static function connection($name)
  20. {
  21. return static::$app['db']->connection($name)->getSchemaBuilder();
  22. }
  23. /**
  24. * Get a schema builder instance for the default connection.
  25. *
  26. * @return \Illuminate\Database\Schema\Builder
  27. */
  28. protected static function getFacadeAccessor()
  29. {
  30. return static::$app['db']->connection()->getSchemaBuilder();
  31. }
  32. }