- What is Larapoke used for in a Laravel application?
- Larapoke registers a small, configurable endpoint that external services or browser scripts can hit to confirm your Laravel app is running and to keep the session and CSRF token fresh. That makes it useful both as a cheap health check for uptime monitors and as a way to stop long-open forms from failing with TokenMismatchException. It is intentionally minimal, with no extra dependencies, and is configured through a published config file.
- How do I install darkghosthunter/larapoke?
- Install it with Composer using composer require darkghosthunter/larapoke. Laravel's package auto-discovery registers the service provider, so no manual wiring is needed in config/app.php. If you want to customize the route path, middleware, or other defaults, publish the package config with php artisan vendor:publish and adjust it there.
- Which Laravel and PHP versions does Larapoke support?
- The v5.x line supports the Laravel versions that were current when it was released, but 5.1.1 is an end-of-line release and the maintainer has said the successor package will carry latest Laravel support instead. That means you should not expect compatibility updates for future Laravel majors or new PHP releases. Always check the exact constraint in the package's composer.json before upgrading your framework.
- Is darkghosthunter/larapoke still maintained?
- No. Version 5.1.1 contains no functional changes, bug fixes, or security patches; it simply announces that the package is superseded by Laragear/Poke. That leaves you with no upstream security patching and no path to future Laravel majors on this package. Treat it as a planned migration rather than a long-term dependency.
- How do I change the Larapoke route or URL?
- Publish the package configuration file and edit the route path, prefix, and middleware settings there. Because the endpoint is exposed through the framework's routing layer, you can also apply middleware such as throttling or a specific guard if you need to restrict access. After changing the config, clear your config cache so the new route definition is picked up.
- Does Larapoke really prevent TokenMismatchException?
- It does not change how CSRF verification works; it gives your front end a lightweight way to ping the app periodically so the session, and therefore the CSRF token, stays valid while a user is filling out a long form. You still need to call that endpoint from your page, for example on a timer in JavaScript. Without a periodic ping, an idle session will still expire and the token will still fail validation.
- How do I test the Larapoke endpoint in my test suite?
- Use Laravel's HTTP testing helpers to make a request to the configured route and assert a successful response, for example $this->get('/poke')->assertOk(). That gives you a fast regression check if someone changes routing or middleware. You can also hit the route with curl in staging to confirm your uptime monitor configuration is pointing at the right path.
- Is it safe to expose the Larapoke ping route publicly?
- The endpoint is intentionally lightweight and returns minimal information, so it does not leak application internals the way a verbose debug page would. Still, apply throttling or restrict it to your monitor's IP ranges if you are worried about abuse. Remember that this package no longer receives security patches, so any future issue becomes yours to handle or backport.
- Should I use Larapoke for a new project or pick an alternative?
- For greenfield work, start on Laragear/Poke instead, since the maintainer has declared it the successor with the same functionality plus newer Laravel support. For an existing service already on v5.x, pin the exact version in composer.json, commit the lockfile, and schedule a migration rather than adopting the package more widely. If you only need a basic health check, Laravel 11's built-in /up route may cover your needs without an extra dependency.
- How do I migrate from Larapoke to Laragear/Poke?
- Start with a timeboxed discovery step: diff the public API, config keys, route names, and any database schema between the two packages, and inventory every call site in your codebase. Then run a branch-only spike that swaps the dependency and runs your existing test suite against the new endpoint. Whether Poke is a drop-in or a rewrite with a migration guide is not documented in the release notes, so confirm that before committing to a deadline.