class Schema extends Facade (View source)

Properties

static protected Application|null $app

The application instance being facaded.

from  Facade
static protected array $resolvedInstance

The resolved object instances.

from  Facade
static protected bool $cached

Indicates if the resolved facade should be cached.

Methods

static void
resolved(Closure $callback)

Run a Closure when the facade has been resolved.

from  Facade
static MockInterface
spy()

Convert the facade into a Mockery spy.

from  Facade
static MockInterface
partialMock()

Initiate a partial mock on the facade.

from  Facade
static Expectation
shouldReceive()

Initiate a mock expectation on the facade.

from  Facade
static Expectation
expects()

Initiate a mock expectation on the facade.

from  Facade
static MockInterface
createFreshMockInstance()

Create a fresh mock instance for the given class.

from  Facade
static MockInterface
createMock()

Create a fresh mock instance for the given class.

from  Facade
static bool
isMock()

Determines whether a mock is set as the instance of the facade.

from  Facade
static string|null
getMockableClass()

Get the mockable class for the bound instance.

from  Facade
static void
swap(mixed $instance)

Hotswap the underlying instance behind the facade.

from  Facade
static bool
isFake()

Determines whether a "fake" has been set as the facade instance.

from  Facade
static mixed
getFacadeRoot()

Get the root object behind the facade.

from  Facade
static string
getFacadeAccessor()

Get the registered name of the component.

static mixed
resolveFacadeInstance(string $name)

Resolve the facade root instance from the container.

from  Facade
static void
clearResolvedInstance(string $name)

Clear a resolved facade instance.

from  Facade
static void
clearResolvedInstances()

Clear all of the resolved instances.

from  Facade
static Collection
defaultAliases()

Get the application default aliases.

from  Facade
static Application|null
getFacadeApplication()

Get the application instance behind the facade.

from  Facade
static void
setFacadeApplication(Application|null $app)

Set the application instance.

from  Facade
static mixed
__callStatic(string $method, array $args)

Handle dynamic, static calls to the object.

from  Facade
static Builder
connection(string|null $name)

Get a schema builder instance for a connection.

static void
defaultStringLength(int $length)

No description

static void
defaultTimePrecision(int|null $precision)

No description

static void
defaultMorphKeyType(string $type)

No description

static void
morphUsingUuids()

No description

static void
morphUsingUlids()

No description

static bool
createDatabase(string $name)

No description

static bool
dropDatabaseIfExists(string $name)

No description

static bool
hasTable(string $table)

No description

static bool
hasView(string $view)

No description

static array
getTables()

No description

static array
getTableListing()

No description

static array
getViews()

No description

static array
getTypes()

No description

static bool
hasColumn(string $table, string $column)

No description

static bool
hasColumns(string $table, array $columns)

No description

static void
whenTableHasColumn(string $table, string $column, Closure $callback)

No description

static void
whenTableDoesntHaveColumn(string $table, string $column, Closure $callback)

No description

static string
getColumnType(string $table, string $column, bool $fullDefinition = false)

No description

static array
getColumnListing(string $table)

No description

static array
getColumns(string $table)

No description

static array
getIndexes(string $table)

No description

static array
getIndexListing(string $table)

No description

static bool
hasIndex(string $table, string|array $index, string|null $type = null)

No description

static array
getForeignKeys(string $table)

No description

static void
table(string $table, Closure $callback)

No description

static void
create(string $table, Closure $callback)

No description

static void
drop(string $table)

No description

static void
dropIfExists(string $table)

No description

static void
dropColumns(string $table, string|array $columns)

No description

static void
dropAllTables()

No description

static void
dropAllViews()

No description

static void
dropAllTypes()

No description

static void
rename(string $from, string $to)

No description

static bool
enableForeignKeyConstraints()

No description

static bool
disableForeignKeyConstraints()

No description

static mixed
withoutForeignKeyConstraints(Closure $callback)

No description

static Connection
getConnection()

No description

static Builder
setConnection(Connection $connection)

No description

static void
blueprintResolver(Closure $resolver)

No description

static void
macro(string $name, object|callable $macro)

No description

static void
mixin(object $mixin, bool $replace = true)

No description

static bool
hasMacro(string $name)

No description

static void
flushMacros()

No description

Details

static void resolved(Closure $callback)

Run a Closure when the facade has been resolved.

Parameters

Closure $callback

Return Value

void

static MockInterface spy()

Convert the facade into a Mockery spy.

Return Value

MockInterface

static MockInterface partialMock()

Initiate a partial mock on the facade.

Return Value

MockInterface

static Expectation shouldReceive()

Initiate a mock expectation on the facade.

Return Value

Expectation

static Expectation expects()

Initiate a mock expectation on the facade.

Return Value

Expectation

static protected MockInterface createFreshMockInstance()

Create a fresh mock instance for the given class.

Return Value

MockInterface

static protected MockInterface createMock()

Create a fresh mock instance for the given class.

Return Value

MockInterface

static protected bool isMock()

Determines whether a mock is set as the instance of the facade.

Return Value

bool

static protected string|null getMockableClass()

Get the mockable class for the bound instance.

Return Value

string|null

static void swap(mixed $instance)

Hotswap the underlying instance behind the facade.

Parameters

mixed $instance

Return Value

void

static bool isFake()

Determines whether a "fake" has been set as the facade instance.

Return Value

bool

static mixed getFacadeRoot()

Get the root object behind the facade.

Return Value

mixed

static protected string getFacadeAccessor()

Get the registered name of the component.

Return Value

string

static protected mixed resolveFacadeInstance(string $name)

Resolve the facade root instance from the container.

Parameters

string $name

Return Value

mixed

static void clearResolvedInstance(string $name)

Clear a resolved facade instance.

Parameters

string $name

Return Value

void

static void clearResolvedInstances()

Clear all of the resolved instances.

Return Value

void

static Collection defaultAliases()

Get the application default aliases.

Return Value

Collection

static Application|null getFacadeApplication()

Get the application instance behind the facade.

Return Value

Application|null

static void setFacadeApplication(Application|null $app)

Set the application instance.

Parameters

Application|null $app

Return Value

void

static mixed __callStatic(string $method, array $args)

Handle dynamic, static calls to the object.

Parameters

string $method
array $args

Return Value

mixed

Exceptions

RuntimeException

static Builder connection(string|null $name)

Get a schema builder instance for a connection.

Parameters

string|null $name

Return Value

Builder

static void defaultStringLength(int $length)

No description

Parameters

int $length

Return Value

void

static void defaultTimePrecision(int|null $precision)

No description

Parameters

int|null $precision

Return Value

void

static void defaultMorphKeyType(string $type)

No description

Parameters

string $type

Return Value

void

static void morphUsingUuids()

No description

Return Value

void

static void morphUsingUlids()

No description

Return Value

void

static bool createDatabase(string $name)

No description

Parameters

string $name

Return Value

bool

static bool dropDatabaseIfExists(string $name)

No description

Parameters

string $name

Return Value

bool

static bool hasTable(string $table)

No description

Parameters

string $table

Return Value

bool

static bool hasView(string $view)

No description

Parameters

string $view

Return Value

bool

static array getTables()

No description

Return Value

array

static array getTableListing()

No description

Return Value

array

static array getViews()

No description

Return Value

array

static array getTypes()

No description

Return Value

array

static bool hasColumn(string $table, string $column)

No description

Parameters

string $table
string $column

Return Value

bool

static bool hasColumns(string $table, array $columns)

No description

Parameters

string $table
array $columns

Return Value

bool

static void whenTableHasColumn(string $table, string $column, Closure $callback)

No description

Parameters

string $table
string $column
Closure $callback

Return Value

void

static void whenTableDoesntHaveColumn(string $table, string $column, Closure $callback)

No description

Parameters

string $table
string $column
Closure $callback

Return Value

void

static string getColumnType(string $table, string $column, bool $fullDefinition = false)

No description

Parameters

string $table
string $column
bool $fullDefinition

Return Value

string

static array getColumnListing(string $table)

No description

Parameters

string $table

Return Value

array

static array getColumns(string $table)

No description

Parameters

string $table

Return Value

array

static array getIndexes(string $table)

No description

Parameters

string $table

Return Value

array

static array getIndexListing(string $table)

No description

Parameters

string $table

Return Value

array

static bool hasIndex(string $table, string|array $index, string|null $type = null)

No description

Parameters

string $table
string|array $index
string|null $type

Return Value

bool

static array getForeignKeys(string $table)

No description

Parameters

string $table

Return Value

array

static void table(string $table, Closure $callback)

No description

Parameters

string $table
Closure $callback

Return Value

void

static void create(string $table, Closure $callback)

No description

Parameters

string $table
Closure $callback

Return Value

void

static void drop(string $table)

No description

Parameters

string $table

Return Value

void

static void dropIfExists(string $table)

No description

Parameters

string $table

Return Value

void

static void dropColumns(string $table, string|array $columns)

No description

Parameters

string $table
string|array $columns

Return Value

void

static void dropAllTables()

No description

Return Value

void

static void dropAllViews()

No description

Return Value

void

static void dropAllTypes()

No description

Return Value

void

static void rename(string $from, string $to)

No description

Parameters

string $from
string $to

Return Value

void

static bool enableForeignKeyConstraints()

No description

Return Value

bool

static bool disableForeignKeyConstraints()

No description

Return Value

bool

static mixed withoutForeignKeyConstraints(Closure $callback)

No description

Parameters

Closure $callback

Return Value

mixed

static Connection getConnection()

No description

Return Value

Connection

static Builder setConnection(Connection $connection)

No description

Parameters

Connection $connection

Return Value

Builder

static void blueprintResolver(Closure $resolver)

No description

Parameters

Closure $resolver

Return Value

void

static void macro(string $name, object|callable $macro)

No description

Parameters

string $name
object|callable $macro

Return Value

void

static void mixin(object $mixin, bool $replace = true)

No description

Parameters

object $mixin
bool $replace

Return Value

void

static bool hasMacro(string $name)

No description

Parameters

string $name

Return Value

bool

static void flushMacros()

No description

Return Value

void