increments('id'); $table->string('email'); }); } public function testEloquentCollectionFresh() { User::insert([ ['email' => 'laravel@framework.com'], ['email' => 'laravel@laravel.com'], ]); $collection = User::all(); $collection->first()->delete(); $freshCollection = $collection->fresh(); $this->assertCount(1, $freshCollection); $this->assertInstanceOf(EloquentCollection::class, $freshCollection); } }