Events

These broadcasting channels allow real-time updates. The frontend can subscribe to them using Pusher.js, or another WebSocket library.

  1. Trip Creation Notification
    1. Channel Name: trip.created.{id}
      1. Authorization: A user can only listen to this channel if their ID matches {id}.
      2. Purpose: This channel notifies a specific user when a trip is created for them.
  2. Trip Departure Notification
    1. Channel Name: trip.departure.{tripId}
      1. Authorization: A user can only listen to this channel if they are associated with the trip.
      2. Purpose: This channel notifies passengers of when the vehicle leaves.
  3. Trip Starting
    1. Channel Name: trip.start.{tripId})
      1. Authorization: A user can only listen to this channel if they are associated with the trip.
      2. Purpose: Notifies users when a trip is about to start.
  4. Funding Wallet
    1. Channel Name: wallet.funded.{userId}
      1. Authorization: The user whose wallet was credited.
      2. Purpose: Notifies the user when their wallet is funded.
  5. Booking Trip
    1. Channel Name: trip.booking.{userId}
    2. Event Name: TripBooked
      1. Authorization: The user who made the booking.
      2. Purpose: Notifies the user when they successfully book a trip.
  6. Trip Cancellation (Driver)
    1. Channel Name: trip.cancelled.{tripId}
      1. Authorization: Users associated with the trip.
      2. Purpose: Notifies users when a trip is canceled.
  7. Booking Cancellation
    1. Channel Name: booking.cancelled.{bookingId}
      1. Authorization: The user who made the booking.
      2. Purpose: Notifies users when a booking is canceled.
  8. Trip Starting (Passenger)
    1. Channel Name: passenger.trip.start.{tripId})
      1. Authorization: A user can only listen to this channel if they are associated with the trip.
      2. Purpose: Notifies users when a trip is has started.
  9. Trip Cancellation (Passenger)
    1. Channel Name: passenger.trip.cancelled.{tripId}
      1. Authorization: Users associated with the trip.
      2. Purpose: Notifies users when a trip is canceled.