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