'Undefined types for fortify in laravel

I'm getting started trying to implement fortify in a react/laravel project I am working on. Following the docs, I did:

composer require laravel/fortify

php artisan vendor:publish --provider="Laravel\Fortify\FortifyServiceProvider"

php artisan migrate

I then went into config/app.php and added:

App\Providers\FortifyServiceProvider::class

under application service providers.

I seem to have all of the fortify files that I need, but throughout all of my files that attempt to use fortify types, I get the error message of undefined type.

As an example, within app\Providers\FortifyServiceProvider.php, I have:

namespace App\Providers;

use Laravel\Fortify\Fortify;

Fortify::createUsersUsing(CreateNewUser::class);

I get an error message "Undefined type 'Laravel\Fortify\Fortify.'"*. I'm having a hard time finding a solution here. Would appreciate any help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source