A short lesson mentioning the assertion helpers related to Eloquent models.
Instead of a typical assertDatabaseHas()
to check the database for specific tables and fields, if you are checking the Eloquent model, you may use the entire model and a assertModelExists()
. Then, you won't need to specify the table and the fields. You will only provide the Eloquent model.
Laravel is smart enough to guess the table from...