InteractsWithDatabase
trait InteractsWithDatabase (View source)
Methods
Assert that a given where condition exists in the database.
Assert that a given where condition does not exist in the database.
Assert the count of table entries.
Assert the given record has been deleted.
Assert the given record has been "soft deleted".
Determine if the argument is a soft deletable model.
Get the database connection.
Seed a given database connection.
Details
protected $this
assertDatabaseHas(string $table, array $data, string|null $connection = null)
Assert that a given where condition exists in the database.
protected $this
assertDatabaseMissing(string $table, array $data, string|null $connection = null)
Assert that a given where condition does not exist in the database.
protected $this
assertDatabaseCount(string $table, int $count, string|null $connection = null)
Assert the count of table entries.
protected $this
assertDeleted(Model|string $table, array $data = [], string|null $connection = null)
Assert the given record has been deleted.
protected $this
assertSoftDeleted(Model|string $table, array $data = [], string|null $connection = null, string|null $deletedAtColumn = 'deleted_at')
Assert the given record has been "soft deleted".
protected bool
isSoftDeletableModel(mixed $model)
Determine if the argument is a soft deletable model.
protected Connection
getConnection(string|null $connection = null)
Get the database connection.
$this
seed(array|string $class = 'DatabaseSeeder')
Seed a given database connection.