Level 60
use http\Client\Curl\User; namespace is incorrect
should be, App\Models\User
Summer Sale! All accounts are 50% off this week.
I'm doing the exercise from lesson 05 :A Project Requires An Owner minute 09:47
I wrote this unit test for User:
namespace Tests\Unit;
use http\Client\Curl\User;
use PHPUnit\Framework\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
class UserTest extends TestCase
{
use RefreshDatabase;
public function test_a_user_has_projects()
{
$user = User::factory()->create();
$this->assertInstanceOf(Collection::class,$user->projects);
}
}
but i get this error which is not present in the course:
i can't solve it
add this use Illuminate\Support\Collection; at the top
Please or to participate in this conversation.