I've removed the actual attributes to just simplify.
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
$factory->define(User::class, function (Faker $faker)
{
return [
...
];
});
Ok I solved the issue. For whatever reason, the UserTest had the use statement of;
use PHPUnit\Framework\TestCase;
Where as it should've been;
use Tests\TestCase;
I have no clue why this was like this and I do not recall changing it at all. Not sure if Laravel comes with this by default?