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

Symfony2 Nodesocket Laravel Package

reactorcoder/symfony2-nodesocket

A Symfony2 bundle that integrates the NodeSocket PHP client, letting your Symfony app publish real-time events to a Node.js WebSocket server. Simple service configuration, event-driven messaging, and easy setup for live updates, notifications, and push features in Symfony projects.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install via Composer: composer require vendor/package (check composer.json for exact name).
  • Publish config: php artisan vendor:publish --tag=gritter-config (or provider tag).
  • Include jQuery and Gritter assets (JS/CSS) in your layout — often via @gritterAssets directive or manual <script>/<link> tags from public/vendor/gritter.
  • First use case: flash a notification from a controller:
    gritter()->success('Saved!', 'Record updated.');
    return redirect()->route('home');
    
    Then render in your Blade layout with {!! gritter()->render() !!} or the package’s included partial.

Implementation Patterns

  • Session‑flashed notifications – Most common: call gritter()->info(...) before redirect; the package stores messages in session and injects them on next request.
  • Multiple notifications – Chain calls or pass arrays:
    gritter()->add('success', 'Title', 'Message', ['time' => 3000]);
    gritter()->add('error', 'Oops', 'Something failed.');
    
  • AJAX / JSON responses – Return gritter payloads manually:
    return response()->json(['gritter' => gritter()->all()]);
    
    Then render client‑side with the Gritter JS API.
  • Custom types & positions – Override defaults in config/gritter.php (e.g., 'position' => 'top-right', 'time' => 5000).
  • Enable/disable via config (1.0.12+) – New config key (likely 'enabled' => true) lets you turn off Gritter rendering entirely. Useful for environments where you want to suppress notifications (e.g., API responses) without removing calls.
  • Blade integration – Use @include('gritter::scripts') or the package’s render method inside your layout after jQuery is loaded.
  • Testing – In tests, set gritter.enabled to false or use gritter()->fake() if supported to avoid session pollution.

Gotchas and Tips

  • Asset publishing – Run php artisan vendor:publish --tag=gritter-assets (or similar) to copy JS/CSS to public/vendor. Forgetting this leads to 404s.
  • jQuery dependency – Gritter requires jQuery. Ensure it’s loaded before the Gritter script; use @stack('scripts') or include order carefully.
  • Config caching – After changing config/gritter.php, run php artisan config:clear in development; in production, re‑cache.
  • Session driver – Notifications rely on session flash. Ensure session middleware is active and the driver supports flash data (all standard drivers do).
  • Render placement – Place {!! gritter()->render() !!} near the end of <body> after jQuery; otherwise notifications may not appear or throw JS errors.
  • Disabling in 1.0.12 – The new config toggle only affects server‑side rendering; if you manually call Gritter JS, it won’t be blocked. Use it to conditionally skip output, not to prevent client‑side calls.
  • Debugging – If notifications don’t show, check: session has gritter key (dd), assets loaded (network tab), JS console for errors, and that the render call is present.
  • Extension points – Override the package’s Blade views by publishing them (--tag=gritter-views) and customising the JS initialisation; or bind a custom implementation of the notification builder in a service provider.
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.
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment