Platform
Your app and our servers, working together
Every netson.cloud server carries a small PHP library that lets your application talk to the platform. Report attacks so the server blocks them, tell the page cache which pages changed. WordPress sites use it automatically. Laravel and custom PHP applications switch it on themselves, with a few lines of code.
Why connect an application to the platform
-
Attacks stopped at the server
Your application knows when a login fails; the server does not. The application reports it, and the server's attack detection blocks an address that keeps failing, on every port of that server.
-
Fresh pages without waiting
Your application tells the platform which pages changed. The page cache clears and warms up exactly those pages.
-
Nothing to run yourself
No agent, no API key and no extra service. We install and update the library on every server. Without it, on your laptop or in a build, your application runs unchanged.
WordPress compared with Laravel and custom PHP
The same library sits underneath both. The difference is who switches it on.
| WordPress | Laravel and custom PHP | |
|---|---|---|
| Switched on | Always on, through the netson.cloud plugin; a plugin or theme cannot disable it | Opt-in: a few lines in your application |
| Security events reported | Failed logins, blocked usernames, user enumeration through the REST API, XML-RPC abuse | Failed logins, lockouts, failed two-factor codes, successful logins, password-reset requests |
| Page cache cleared on change | Automatically (publish, update, delete, comments, menus, categories) | When your code asks for it: per URL, all pages or the sitemaps |
| Images to WebP and AVIF | Automatically, originals untouched | Not available yet |
| Without the platform | The plugin shows why a feature is off; the site keeps working | Your application runs as before; the calls do nothing |
Laravel: getting started
The library is not a public package and not open source. It is installed by the platform and loaded from the server when it is there. You add the lines below once; your developers keep owning their code and their deploys, and we help you set it up.
1. Register the provider
This function, with use Illuminate\Contracts\Foundation\Application; and use Netson\Platform\Laravel\PlatformServiceProvider;:
function registerPlatformLibrary(Application $app, string $library): bool
{
// Platform hosts only: on a laptop or build machine the file is absent.
if (!is_file($library)) {
return false;
}
try {
require_once $library;
if (class_exists(PlatformServiceProvider::class)) {
$app->register(PlatformServiceProvider::class);
return true;
}
} catch (\Throwable) {
// A broken library disables the feed, never the app.
}
return false;
}
Call it from register() in app/Providers/AppServiceProvider.php: registerPlatformLibrary($this->app, '/usr/local/share/netson-platform-php/v1/autoload.php');. Use register(), not bootstrap/providers.php: that list is cached when your release is built, and the library exists only on the server. From then on, Laravel's failed-login, lockout, login and failed two-factor events are reported automatically.
2. Report a password-reset request
Laravel has no event for "a reset link was requested". Report it yourself, with use Illuminate\Http\Request; and use Netson\Platform\NetsonCloud;:
/**
* Call this wherever a reset link is requested. Safe without the library, without a
* request address (console, queue) and when the platform is in trouble.
*/
function recordResetRequested(Request $request): void
{
$ip = $request->server('REMOTE_ADDR');
if (!class_exists(NetsonCloud::class) || !is_string($ip) || $ip === '') {
return; // no library, or no TCP peer: nothing to record
}
// REMOTE_ADDR, never $request->ip(): behind a proxy ip() follows X-Forwarded-For,
// which the client controls. Never record the email address, not even hashed.
app(NetsonCloud::class)->security()->record('auth.reset_requested', $ip);
}
3. Clear the page cache after a change
With use Netson\Platform\Cache\Intents; and use Netson\Platform\NetsonCloud;, for example purgeNewsPages(url('/'), $post->slug) after a news item is published:
/**
* Clear the cached news overview and the item that changed.
*/
function purgeNewsPages(string $base, string $slug): bool
{
if (!class_exists(NetsonCloud::class)) {
return false; // no library on this machine: nothing to purge
}
$cache = app(NetsonCloud::class)->cache();
if (!$cache->available()) {
return false; // this site has no page cache
}
$changes = new Intents();
$changes->addUrls(["{$base}/news/{$slug}", "{$base}/news"], 'news:published');
return $cache->flush($changes, '')->isOk();
}
available() is false when your site has no page cache; the function then does nothing.
4. Check what is available
With $cloud = app(NetsonCloud::class);:
$offers = [];
foreach (['security.feed', 'cache'] as $feature) {
$offers[$feature] = $cloud->supports($feature);
}
$state = $cloud->state(); // "ready", or why the platform is not usable here
$why = $cloud->stateReason();
Plain PHP without Laravel works the same way: require /usr/local/share/netson-platform-php/v1/autoload.php and use Netson\Platform\NetsonCloud::forPath(__DIR__).
Every class and method these examples use is described in the API reference, generated from the library's code for the version our servers run.
What we promise
-
It never breaks your application
Calls never throw on platform trouble. They return a result, and features switch themselves off.
-
Stable within a major version
Your code loads v1. A breaking change ships as a new major version next to the old one.
-
Retired features keep answering
A feature that is retired answers "not available" instead of disappearing.
-
Your site only
Each site reads only its own configuration. A copy restored into another site refuses to act for the original.
Questions
Do I need to install anything?
No. We install and update the library on every server. You add the lines above to your application once.
Will my own office be blocked?
Only an address with far more failures than a person makes is blocked. Office addresses can be put on an allow list; tell us which.
What do you store about my users?
For each event its type, the visitor's IP address and the time. Never an e-mail address or a username.
Does it work for other PHP frameworks?
Yes, with plain PHP calls. Laravel gets a ready-made provider.