Hi!
I've seen many posts like this but none of them helped. The application works on my windows pc bot not on the linux server.
My error is:
Class "app\enums\Departments" not found
The file exists on the linux server under "app/enums/Departments.php". In development I was using "App\Enums\Departments" and worked but after this error, I changed it to "app\enums\Departments"
I've cleared cache and run composer dump-autoload but the error persists.
Any clue?
This is the Department code:
<?php
namespace App\Enums;
enum Departments: int
{
case IT = 1;
case Adminisracion = 2;
case IDi = 3;
case Food = 4;
case ESG = 5;
case Calidad = 6;
public function label(): string
{
return match($this) {
self::IT => 'IT',
self::Adminisracion => 'Adminisración',
self::IDi => 'IDi',
self::Food => 'Food',
self::ESG => 'ESG',
self::Calidad => 'Calidad',
};
}
}
@tykus
I got it working naming like this:
path: app/enums/Department
namespace: namespace App\enums;
class call: \App\enums\Departments::cases()
I understand its because of linux case sensitivity. But why does the namespace and the class call need to have App in caps while the path is not in caps? It is confusing!