Xgenious/ docs

Hooks, Slots & Registry

Actions (Events)

Fire after state changes. Payloads are scalars/arrays only — never models or requests.

// Register an action
$this->ctx->hooks->addAction('order.paid', function (int $orderId, array $meta): void {
    // React to order payment
});

// Fire a custom action
plugin_do_action('myplugin.order_processed', $orderId, $data);

Common Core Actions

HookPayloadWhen
user.registered$userId, $dataNew user signs up
user.login$userId, $dataUser logs in
order.paid$orderId, $dataOrder payment confirmed
order.completed$orderIdOrder marked complete
wallet.deposit.completed$historyId, $dataWallet deposit confirmed
subscription.activated$subscriptionIdSubscription activated
proposal.rejected$jobId, $freelancerId, $clientIdProposal rejected

Filters (Value Transformation)

Input value in, transformed value out.

// Register a filter
$this->ctx->hooks->addFilter('checkout.price.calculate',
    fn(float $price, array $ctx = []): float => $price * 0.95  // 5% discount
);

// Apply a filter
$value = plugin_apply_filters('myplugin.data', $default, $context);

Common Core Filters

HookTransformContext
checkout.price.calculatefloat priceorder_kind, freelancer_id, client_id
user.create_dataarray of fillable dataUser registration
job.create_dataarray of fillable dataJob creation
menu.primary_itemsarray of menu itemsNavbar rendering
seo.meta_titlestring titlePage rendering
payment.completearray resultIPN verification

Slots (HTML Injection Points)

Named render points with context arrays.

// Register a slot renderer
$this->ctx->slots->register('checkout.coupon_field', 'my-plugin.coupon',
    fn(array $context): string => '<input name="coupon_code" placeholder="Coupon">'
);

// Render a slot (called by core)
$output = plugin_render_slot('checkout.coupon_field', ['order_id' => $id]);

Available Slots

SlotContextLocation
checkout.coupon_field—Checkout page
order.success_afterorder_idOrder success page
order.details_afterorder_id, roleOrder details page
job.proposal_box_afterjob_idJob details page
project.offer_box_afterproject_idProject details page
profile.completionuser_id, roleProfile completion
dashboard.referral_panelrole, user_idUser dashboard
admin.dashboard_widgets—Admin dashboard
admin.order_details_afterorder_idAdmin order details
admin.user_details_afteruser_idAdmin user details

Registry (Structured Contributions)

Generic priority-ordered registry for typed domains.

// Register an entry
$this->ctx->registry->register('admin.menu', 'my-plugin', [
    'label' => 'My Plugin',
    'route' => '/admin/my-plugin',
    'icon' => 'fa-solid fa-star',
    'permissions' => 'my-plugin-manage',
]);

// Get all entries for a domain
$all = $this->ctx->registry->all('admin.menu');

// Check if entry exists
$exists = $this->ctx->registry->has('gateway', 'mygateway');

Registry Domains

DomainEntry Shape
gatewayid, label, module, ipn_route, settings_prefix, enabled_option
checkout.adjusterid, label, adjust: callable
admin.menulabel, route, icon, permissions
dashboard.menulabel, route, icon, roles
widgettitle, render: callable
auth.providerid, label, redirect, callback

Last updated: September 2026

Still stuck?
Our support team is ready to help you get set up.
Get support