Schema.php 3.2 KB

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