trait
Illuminate
/
Foundation
/
Testing
/
Concerns
/
InteractsWithDatabase
You are viewing an older version of the documentation. For the latest, please visit master documentation.
InteractsWithDatabase
Methods
protected
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
protected
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
protected
assertDatabaseCount ( $table , int $count , $connection ) : $this
Assert the count of table entries.
Parameters
- $table Model |string
- $count int
- $connection string|null
protected
assertDeleted ( $table , array $data , $connection ) : $this
Assert the given record has been deleted.
Parameters
- $table Model |string
- $data array
- $connection string|null
protected
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
protected
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
protected
assertModelExists ( $model ) : $this
Assert the given model exists in the database.
Parameters
- $model Model
protected
assertModelMissing ( $model ) : $this
Assert the given model does not exist in the database.
Parameters
- $model Model
protected
isSoftDeletableModel ( $model ) : bool
Determine if the argument is a soft deletable model.
Parameters
- $model mixed
public
castAsJson ( $value ) : Expression
Cast a JSON string to a database compatible type.
Parameters
- $value array|string
protected
getConnection ( $connection ) : Connection
Get the database connection.
Parameters
- $connection string|null
protected
getTable ( $table ) : string
Get the table name from the given model or string.
Parameters
- $table Model |string
public
seed ( $class ) : $this
Seed a given database connection.
Parameters
- $class array|string