create(); $asset = Asset::factory() ->create( [ 'model_id' => AssetModel::factory() ->create( [ 'category_id' => Category::factory()->assetLaptopCategory()->id ] )->id, 'warranty_months' => 24, 'purchase_date' => Carbon::createFromDate(2017, 1, 1)->hour(0)->minute(0)->second(0)->format('Y-m-d') ]); Notification::fake(); $asset->checkOut($user, $asset->id); Notification::assertSentTo($user, CheckoutAssetNotification::class); } }