1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CodexShaper\Database\Facades; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\Facades\Facade; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* @method static \Illuminate\Database\Schema\Builder create(string $table, \Closure $callback) |
9
|
|
|
* @method static \Illuminate\Database\Schema\Builder drop(string $table) |
10
|
|
|
* @method static \Illuminate\Database\Schema\Builder dropIfExists(string $table) |
11
|
|
|
* @method static \Illuminate\Database\Schema\Builder table(string $table, \Closure $callback) |
12
|
|
|
* @method static \Illuminate\Database\Schema\Builder rename(string $from, string $to) |
13
|
|
|
* @method static void defaultStringLength(int $length) |
14
|
|
|
* @method static bool hasTable(string $table) |
15
|
|
|
* @method static bool hasColumn(string $table, string $column) |
16
|
|
|
* @method static bool hasColumns(string $table, array $columns) |
17
|
|
|
* @method static \Illuminate\Database\Schema\Builder disableForeignKeyConstraints() |
18
|
|
|
* @method static \Illuminate\Database\Schema\Builder enableForeignKeyConstraints() |
19
|
|
|
* @method static void registerCustomDoctrineType(string $class, string $name, string $type) |
20
|
|
|
* |
21
|
|
|
* @see \Illuminate\Database\Schema\Builder |
22
|
|
|
*/ |
23
|
|
|
class Schema extends Facade |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* Get a schema builder instance for a connection. |
27
|
|
|
* |
28
|
|
|
* @param string|null $name |
29
|
|
|
* |
30
|
|
|
* @return \Illuminate\Database\Schema\Builder |
31
|
|
|
*/ |
32
|
|
|
public static function connection($name) |
33
|
|
|
{ |
34
|
|
|
return DB::connection($name)->getSchemaBuilder(); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Get a schema builder instance for the default connection. |
39
|
|
|
* |
40
|
|
|
* @return \Illuminate\Database\Schema\Builder |
41
|
|
|
*/ |
42
|
|
|
protected static function getFacadeAccessor() |
43
|
|
|
{ |
44
|
|
|
return DB::connection()->getSchemaBuilder(); |
45
|
|
|
} |
46
|
|
|
} |
47
|
|
|
|