whats the exact name of the folder containing your class
Dec 29, 2024
4
Level 1
Helper file not registering
Hello, I am trying to set up a bitwise authentication. For this I am trying to create a Helper file (app/Helpers/RoleHelper.php). So that I can check the bits to the defined roles. Sadly enough the file / namespace is not found.
RoleHelper.php
namespace App\Helpers;
class RoleHelper
{
const NONE = 0b0000;
const USER = 0b0001;
const EMPLOYEE = 0b0010;
const ADMIN = 0b0100;
const EMPLOYEE_USER = self::USER | self::EMPLOYEE; // 0011
const ADMIN_ALL = self::USER | self::EMPLOYEE | self::ADMIN; // 0111
}
Composer.json
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/",
"App\\": "app/"
// Tried this to in the past "App\\Helpers\\": "app/Helpers/"
},
"files": [
"app/Helpers/RoleHelper.php"
]
},
I did the "composer dump-autoload"
I tried use App\Helpers\RoleHelper; I tried adding the \App\Helpers\RoleHelper::EMPLOYEE directly.
I realy am at a loss here
Please or to participate in this conversation.