On this page
DatabaseTruncation
trait DatabaseTruncation (View source)
Traits
Properties
static protected array | $allTables | The cached names of the database tables for each connection. |
Methods
array | migrateFreshUsing() The parameters that should be used when running "migrate:fresh". |
from CanConfigureMigrationCommands |
bool | shouldDropViews() Determine if views should be dropped when refreshing the database. |
from CanConfigureMigrationCommands |
bool | shouldDropTypes() Determine if types should be dropped when refreshing the database. |
from CanConfigureMigrationCommands |
bool | shouldSeed() Determine if the seed task should be run when refreshing the database. |
from CanConfigureMigrationCommands |
mixed | seeder() Determine the specific seeder class that should be used when refreshing the database. |
from CanConfigureMigrationCommands |
void | truncateDatabaseTables() Truncate the database tables for all configured connections. |
|
void | truncateTablesForAllConnections() Truncate the database tables for all configured connections. |
|
void | truncateTablesForConnection(ConnectionInterface $connection, string|null $name) Truncate the database tables for the given database connection. |
|
array | connectionsToTruncate() The database connections that should have their tables truncated. |
|
array | exceptTables(string|null $connectionName) Get the tables that should not be truncated. |
Details
protected array migrateFreshUsing()
The parameters that should be used when running "migrate:fresh".
protected bool shouldDropViews()
Determine if views should be dropped when refreshing the database.
protected bool shouldDropTypes()
Determine if types should be dropped when refreshing the database.
protected bool shouldSeed()
Determine if the seed task should be run when refreshing the database.
protected mixed seeder()
Determine the specific seeder class that should be used when refreshing the database.
protected void truncateDatabaseTables()
Truncate the database tables for all configured connections.
protected void truncateTablesForAllConnections()
Truncate the database tables for all configured connections.
protected void truncateTablesForConnection(ConnectionInterface $connection, string|null $name)
Truncate the database tables for the given database connection.
protected array connectionsToTruncate()
The database connections that should have their tables truncated.
protected array exceptTables(string|null $connectionName)
Get the tables that should not be truncated.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Foundation/Testing/DatabaseTruncation.html