InteractsWithDatabase
Methods
assertDatabaseHas ( $table , array $data , $connection ) : $this
Assert that a given where condition exists in the database.
Parameters
- $table Model |string
- $data array
- $connection string|null
assertDatabaseMissing ( $table , array $data , $connection ) : $this
Assert that a given where condition does not exist in the database.
Parameters
- $table Model |string
- $data array
- $connection string|null
assertDatabaseCount ( $table , int $count , $connection ) : $this
Assert the count of table entries.
Parameters
- $table Model |string
- $count int
- $connection string|null
assertDatabaseEmpty ( $table , $connection ) : $this
Assert that the given table has no entries.
Parameters
- $table Model |string
- $connection string|null
assertSoftDeleted ( $table , array $data , $connection , $deletedAtColumn ) : $this
Assert the given record has been "soft deleted".
Parameters
- $table Model |string
- $data array
- $connection string|null
- $deletedAtColumn string|null
assertNotSoftDeleted ( $table , array $data , $connection , $deletedAtColumn ) : $this
Assert the given record has not been "soft deleted".
Parameters
- $table Model |string
- $data array
- $connection string|null
- $deletedAtColumn string|null
assertModelExists ( $model ) : $this
Assert the given model exists in the database.
Parameters
- $model Model
assertModelMissing ( $model ) : $this
Assert the given model does not exist in the database.
Parameters
- $model Model
expectsDatabaseQueryCount ( $expected , $connection ) : $this
Specify the number of database queries that should occur throughout the test.
Parameters
- $expected int
- $connection string|null
isSoftDeletableModel ( $model ) : bool
Determine if the argument is a soft deletable model.
Parameters
- $model mixed
castAsJson ( $value ) : Expression
Cast a JSON string to a database compatible type.
Parameters
- $value array|object|string
getConnection ( $connection , $table ) : Connection
Get the database connection.
Parameters
- $connection string|null
- $table string|null
getTable ( $table ) : string
Get the table name from the given model or string.
Parameters
- $table Model |string
getTableConnection ( $table ) : string|null
Get the table connection specified in the given model.
Parameters
- $table Model |string
getDeletedAtColumn ( $table , $defaultColumnName ) : string
Get the table column name used for soft deletes.
Parameters
- $table string
- $defaultColumnName string
newModelFor ( $table ) : Model |null
Get the model entity from the given model or string.
Parameters
- $table Model |string
seed ( $class ) : $this
Seed a given database connection.
Parameters
- $class array|string