Models Expectations

toBeDeleted()

Assert the given model to be deleted.

expect($model)->toBeDeleted();

toBeSoftDeleted()

Assert the given model to be soft deleted.

expect($model)->toBeSoftDeleted();

toExist()

Assert the given model exists in the database.

expect($model)->toExist();

toBelongTo()

Assert the given model belongs to another one.

expect($post)->toBelongTo($user);

toOwn()

Assert the given model owns child model.

expect($user)->toOwn($post); //<-- HasMany relationship

expect($user)->toOwn($address); //<-- HasOne relationship
Edit this page on GitHub Updated at Fri, Oct 15, 2021