Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Poke Laravel Package

laragear/poke

Laragear Poke is a small Laravel utility for poking your application: dispatch a quick signal, run a lightweight task, or confirm a service is alive using a clean, fluent API with minimal setup and no configuration. It fits neatly into Laravel's ecosystem, so pokes can run in tests, scheduled jobs,...

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with Composer: composer require laragear/poke. The service provider is auto-discovered; no manual registration needed.
  • Publish the config: php artisan vendor:publish --tag=poke-config. This is where you set the default driver (broadcast, database, log), channel naming, and queue settings.
  • The core API is a single action: send a poke to a user. In its simplest form: Poke::to($user)->send('Message');. Pokes are lightweight, ephemeral signals—think toast notifications or badges.
  • First use case: after a user saves a record in a Filament resource, send a poke to a teammate so they see a real-time toast. Or in a Livewire component, use the new Pokeable trait to listen for pokes and display them.
  • Where to look first: config/poke.php for driver and channel config; the Laragear\Poke namespace for the facade and the new Livewire and Filament helper classes.

Implementation Patterns

  • Sending pokes: Use the Poke facade from controllers, jobs, or event listeners. For async delivery, set the queue connection in config; pokes will be dispatched as jobs.
  • Livewire integration (v5.1.0): Add the Pokeable trait to your Livewire component. It registers a listener on the user's private poke channel and exposes a hook (e.g., onPoke) where you can dispatch a browser event to show a toast. No manual Echo setup needed.
  • Filament integration (v5.1.0): Use the provided PokeAction in resource tables or page actions. It opens a modal to compose a poke and sends it to the record's user. Customize the recipient resolution and form via the action's fluent methods.
  • Workflow: Treat pokes as fire-and-forget. For persistent notifications, pair Poke with Laravel's notification system—use notifications for the inbox, Poke for the real-time "ping."
  • Integration tips: If you're already using Laravel Echo, the package reuses your broadcasting setup. Ensure the poke channel is authorized; the package may ship a default channel callback you can override.

Gotchas and Tips

  • Ephemeral by design: Pokes are not persisted by default (unless you enable the database driver). Don't rely on them for audit trails or critical delivery.
  • Broadcasting prerequisites: Real-time pokes need a broadcasting driver (Reverb, Pusher, etc.). If pokes aren't arriving, check BROADCAST_CONNECTION, queue workers, and that the user is authenticated on the private channel.
  • Livewire trait conflicts: If your component already defines getListeners(), ensure the trait's listeners are merged. In Livewire 3, the trait likely uses #[On('poke')], so no manual merge is needed—but verify after upgrading.
  • Filament assets: After installing, run php artisan filament:assets if the package ships JS/CSS for the action modal. Also clear cached views if the action doesn't appear.
  • Testing: Use Poke::fake() to assert pokes were sent without hitting the broadcaster. For Filament, test the action via livewire() assertions on the table.
  • Config quirks: The default channel name is poke.{user_id}; if you use multiple guards or a custom user model, adjust the channel resolution in config/poke.php. The driver can be swapped (broadcast, database, log) for local development.
  • Extension points: Implement the PokeDriver contract to add a custom delivery channel (e.g., SMS or Slack). The Livewire trait's getPokeChannel() method can be overridden for per-component channels.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core