1. Go to this page and download the library: Download beebmx/kirby-patrol 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/ */
beebmx / kirby-patrol example snippets
use Kirby\Cms\App;
use Kirby\Cms\Pages;
use Kirby\Cms\Site;
'beebmx.kirby-patrol' => [
'content' => [
'query' => function (Site $site, Pages $pages, App $kirby) {
return $site->find('secure-page')->children()->listed();
},
],
],
use Beebmx\KirbyMiddleware\Request;
use Closure;
use Kirby\Cms\App;
use Kirby\Exception\ErrorPageException;
class MyCustomMiddleware
{
public function handle(Request $request, Closure $next)
{
$kirby = App::instance();
if ($kirby->site()->isDisabled()->toBool()) {
return throw new ErrorPageException([
'fallback' => 'Unauthorized',
'httpCode' => 401,
]);
}
return $next($data);
}
}