Schema.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace Illuminate\Support\Facades;
  3. /**
  4. * @method static void defaultStringLength(int $length)
  5. * @method static void defaultMorphKeyType(string $type)
  6. * @method static void morphUsingUuids()
  7. * @method static void morphUsingUlids()
  8. * @method static bool createDatabase(string $name)
  9. * @method static bool dropDatabaseIfExists(string $name)
  10. * @method static bool hasTable(string $table)
  11. * @method static bool hasView(string $view)
  12. * @method static array getTables()
  13. * @method static array getTableListing()
  14. * @method static array getViews()
  15. * @method static array getTypes()
  16. * @method static bool hasColumn(string $table, string $column)
  17. * @method static bool hasColumns(string $table, array $columns)
  18. * @method static void whenTableHasColumn(string $table, string $column, \Closure $callback)
  19. * @method static void whenTableDoesntHaveColumn(string $table, string $column, \Closure $callback)
  20. * @method static string getColumnType(string $table, string $column, bool $fullDefinition = false)
  21. * @method static array getColumnListing(string $table)
  22. * @method static array getColumns(string $table)
  23. * @method static array getIndexes(string $table)
  24. * @method static array getIndexListing(string $table)
  25. * @method static bool hasIndex(string $table, string|array $index, string|null $type = null)
  26. * @method static array getForeignKeys(string $table)
  27. * @method static void table(string $table, \Closure $callback)
  28. * @method static void create(string $table, \Closure $callback)
  29. * @method static void drop(string $table)
  30. * @method static void dropIfExists(string $table)
  31. * @method static void dropColumns(string $table, string|array $columns)
  32. * @method static void dropAllTables()
  33. * @method static void dropAllViews()
  34. * @method static void dropAllTypes()
  35. * @method static void rename(string $from, string $to)
  36. * @method static bool enableForeignKeyConstraints()
  37. * @method static bool disableForeignKeyConstraints()
  38. * @method static mixed withoutForeignKeyConstraints(\Closure $callback)
  39. * @method static \Illuminate\Database\Connection getConnection()
  40. * @method static \Illuminate\Database\Schema\Builder setConnection(\Illuminate\Database\Connection $connection)
  41. * @method static void blueprintResolver(\Closure $resolver)
  42. * @method static void macro(string $name, object|callable $macro, object|callable $macro = null)
  43. * @method static void mixin(object $mixin, bool $replace = true)
  44. * @method static bool hasMacro(string $name)
  45. * @method static void flushMacros()
  46. *
  47. * @see \Illuminate\Database\Schema\Builder
  48. */
  49. class Schema extends Facade
  50. {
  51. /**
  52. * Indicates if the resolved facade should be cached.
  53. *
  54. * @var bool
  55. */
  56. protected static $cached = false;
  57. /**
  58. * Get a schema builder instance for a connection.
  59. *
  60. * @param string|null $name
  61. * @return \Illuminate\Database\Schema\Builder
  62. */
  63. public static function connection($name)
  64. {
  65. return static::$app['db']->connection($name)->getSchemaBuilder();
  66. }
  67. /**
  68. * Get the registered name of the component.
  69. *
  70. * @return string
  71. */
  72. protected static function getFacadeAccessor()
  73. {
  74. return 'db.schema';
  75. }
  76. }