class Schema (View source)

Methods

static 
table(string $table, Closure $builder)

Mulai operasi schema terhadap tabel.

static array
tables(string $connection = null)

List semua tabel di database saat ini.

static array
columns(string $table, string|null $connection = null)

List seluruh kolom milik suatu tabel saat ini.

static bool
has_table(string $table, string|null $connection = null)

Cek apakah tabel ada di database saat ini.

static bool
has_column(string $table, string $column, string|null $connection = null)

Cek apakah kolom ada di suatu tabel.

static bool
enable_fk_checks(string $table, string|null $connection = null)

Hidupkan foreign key constraint checking.

static bool
disable_fk_checks(string $table, string|null $connection = null)

Matikan foreign key constraint checking.

static 
create(string $table, Closure $builder)

Buat skema tabel baru.

static 
create_if_not_exists(string $table, Closure $builder)

Buat skema tabel baru jika tabel belum ada.

static 
rename(string $table, string $new_name)

Ganti nama tabel.

static 
drop(string $table, string $connection = null)

Hapus tabel dari skema.

static 
drop_if_exists(string $table, string $connection = null)

Hapus tabel dari skema (hanya jika tabelnya ada).

static 
execute(Table $table)

Jalankan operasi skema terhadap database.

static 
implications(Table $table)

Tambahkan perintah implisit apapun ke operasi skema.

static Grammar
grammar(Connection $connection)

Mereturn query grammar yang sesuai untuk driver database saat ini.

Details

static table(string $table, Closure $builder)

Mulai operasi schema terhadap tabel.

Parameters

string $table
Closure $builder

static array tables(string $connection = null)

List semua tabel di database saat ini.

Parameters

string $connection

Return Value

array

static array columns(string $table, string|null $connection = null)

List seluruh kolom milik suatu tabel saat ini.

Parameters

string $table
string|null $connection

Return Value

array

static bool has_table(string $table, string|null $connection = null)

Cek apakah tabel ada di database saat ini.

Parameters

string $table
string|null $connection

Return Value

bool

static bool has_column(string $table, string $column, string|null $connection = null)

Cek apakah kolom ada di suatu tabel.

Parameters

string $table
string $column
string|null $connection

Return Value

bool

static bool enable_fk_checks(string $table, string|null $connection = null)

Hidupkan foreign key constraint checking.

Parameters

string $table
string|null $connection

Return Value

bool

static bool disable_fk_checks(string $table, string|null $connection = null)

Matikan foreign key constraint checking.

Parameters

string $table
string|null $connection

Return Value

bool

static create(string $table, Closure $builder)

Buat skema tabel baru.

Parameters

string $table
Closure $builder

static create_if_not_exists(string $table, Closure $builder)

Buat skema tabel baru jika tabel belum ada.

Parameters

string $table
Closure $builder

static rename(string $table, string $new_name)

Ganti nama tabel.

Parameters

string $table
string $new_name

static drop(string $table, string $connection = null)

Hapus tabel dari skema.

Parameters

string $table
string $connection

static drop_if_exists(string $table, string $connection = null)

Hapus tabel dari skema (hanya jika tabelnya ada).

Parameters

string $table
string $connection

static execute(Table $table)

Jalankan operasi skema terhadap database.

Parameters

Table $table

static protected implications(Table $table)

Tambahkan perintah implisit apapun ke operasi skema.

Parameters

Table $table

static Grammar grammar(Connection $connection)

Mereturn query grammar yang sesuai untuk driver database saat ini.

Parameters

Connection $connection

Return Value

Grammar