Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jefrycayo's avatar

Can't login on multiple panels

I was using my default admin panel , i then created a new one called cashiers, whrn i try to log in it says credentials not found but when i try to login on the default one it does log in. Does it have to do with the user resource not being part of the cashier panel?

0 likes
3 replies
jlrdw's avatar

I would say yes.

Just have one users table with authentication (a login required)

Use authorization to determine who can do what.

On cashier panel authorize the "cashier" to have access.

1 like
jefrycayo's avatar

no really dude, i just figured out it was something in the

public function canAccessPanel(Panel $panel): bool { // Check if the panel ID is 'administration' if ($panel->getId() === 'administration') { // Define the roles that can access the administration panel $allowedRoles = [ Role::tecnico->value, Role::director->value, Role::gerente->value, Role::administration->value, Role::contable->value, ]; // Return true if the user's role is in the allowedRoles array return in_array($this->role, $allowedRoles, true); }

    if ($panel->getId() === 'operation') {
        $allowedRoles = [
            Role::cajero->value,
            Role::hostess->value,
        ];
        return in_array($this->role, $allowedRoles, true);
    }

    // Return false if the panel ID is not 'administration'
    return false;
}
aidil's avatar

@jefrycayo Ensure the canAccessPanel function includes a condition for the cashier panel and assigns appropriate roles to allow access.

1 like

Please or to participate in this conversation.