trait InteractsWithDatabase (View source)

Methods

$this
assertDatabaseHas(string $table, array $data, string $connection = null)

Assert that a given where condition exists in the database.

$this
assertDatabaseMissing(string $table, array $data, string $connection = null)

Assert that a given where condition does not exist in the database.

$this
assertSoftDeleted(string $table, array $data, string $connection = null)

Assert the given record has been deleted.

getConnection(string|null $connection = null)

Get the database connection.

$this
seed(string $class = 'DatabaseSeeder')

Seed a given database connection.

Details

protected $this assertDatabaseHas(string $table, array $data, string $connection = null)

Assert that a given where condition exists in the database.

Parameters

string $table
array $data
string $connection

Return Value

$this

protected $this assertDatabaseMissing(string $table, array $data, string $connection = null)

Assert that a given where condition does not exist in the database.

Parameters

string $table
array $data
string $connection

Return Value

$this

protected $this assertSoftDeleted(string $table, array $data, string $connection = null)

Assert the given record has been deleted.

Parameters

string $table
array $data
string $connection

Return Value

$this

protected Connection getConnection(string|null $connection = null)

Get the database connection.

Parameters

string|null $connection

Return Value

Connection

$this seed(string $class = 'DatabaseSeeder')

Seed a given database connection.

Parameters

string $class

Return Value

$this