Reputation: 21
When i use Enum in laravel it gives me error during package installation and composer commands: Generating optimized autoload files
Class App\Enums\Gender:string located in MyProject\app\Enums\Gender.php does not comply with psr-4 autoloading standard. Skipping.
I Want to use php(8.1) feature Enum in laravel(9)
Upvotes: 1
Views: 592
Reputation: 21
There should be space between "Gender:" and "string".
I change this:
enum Gender:string {
case Male = 'male';
case Female = 'female';
}
to this:
enum Gender: string {
case Male = 'male';
case Female = 'female';
}
The problem Solved.
Upvotes: 1