PHP code example of lexide / lazy-boy

1. Go to this page and download the library: Download lexide/lazy-boy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lexide / lazy-boy example snippets


class RoleAuthoriser implements AuthoriserInterface
{

    protected $usersDao;

    public function __construct(UsersDao $usersDao)
    {
        $this->usersDao = $usersDao;
    }

    public function checkAuthorisation(RequestInterface $request, array $securityContext): bool
    {
        $route = $request->getAttribute("route");
        $userId = $route->getArgument("id");
        $user = $this->usersDao->getUser($userId);
        return $user->getRole() == $securityContext["role"];
    }

}