简体   繁体   中英

“does not comply with psr-4 autoloading standard.” What am i doing wrong in this case?

Class Database\Factories\Tasks\UserFactory located in./database/factories/tasks/UserFactory.php does not comply with psr-4 autoloading standard. Skipping.

This is my php file:

<?php

namespace Database\Factories\Tasks;

use App\Models\Tasks\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

class UserFactory extends Factory
{
  ...
}

Located in: database/factories/tasks/

Can someone explain me why this doesnt comply with psr-4 autoloading standard?

PSR-4 Autoload Standard is case sensitive. So If your Namespace starts with an Uppercase, your Folder name should do this also.

In your example, the directory should be Database/Factories/Tasks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM