1. Go to this page and download the library: Download cyberma/laravel-layer-frame 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/ */
cyberma / laravel-layer-frame example snippets
use Cyberma\LayerFrame\Contracts\Repositories\IRepository;
use Cyberma\LayerFrame\DBStorage\Aggregates\ScalarQuery;
final class UserRepository
{
public function __construct(
private readonly IRepository $repository
) {
}
public function getActiveUserCount(): int
{
return (int)$this->repository->scalar(
ScalarQuery::count(),
[['status', '=', 'active']]
);
}
}