Download the PHP package rohitshakya/laravel-beacon without Composer

On this page you can find all versions of the php package rohitshakya/laravel-beacon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-beacon

🔔 Beacon

Realtime Notification UI for Laravel

Like a lighthouse in the dark, Beacon signals new activity to your users.

Beacon is a drop-in notification UI for Laravel that provides a topbar dropdown, inbox page, and realtime updates using Livewire and broadcasting. It is designed to be elegant, customizable, and easy to integrate into any Laravel app — and it works for any notifiable model, not just App\Models\User.


Why "Beacon"?

A beacon is a guiding signal — a lighthouse that alerts ships of activity and direction.

This package acts the same way:

Instead of silently storing notifications in the database, Beacon announces them to users through UI, events, and realtime broadcasting.


Features


📦 Installation

Publish config:

Publish views (optional):


Quick Usage

1. Add the topbar

The simplest case — render for the currently authenticated user:

Or mount the Livewire component directly:

Both fall back to auth()->user() when no notifiable is passed.

Render for any notifiable

Pass any model that uses the Notifiable trait:

Or via the Livewire tag with explicit class + id:

The same applies to the inbox:

Security note: the notifiableClass and notifiableId props on the Livewire components are marked #[Locked], so the client cannot mutate them after mount. The backend must decide which notifiable a given page may view.

Multiple topbars on one page

You can render multiple topbars side by side — for example, an admin dashboard showing a personal bell and a reseller-impersonation bell. Each one binds its own private Echo channel, so they update independently:


2. Send a notification

Beacon will automatically appear in UI for whoever the topbar is mounted for.


3. Listen in JS (optional)


Realtime Setup

Beacon supports:

Make sure Echo is running. You do not need to call Echo.private(...) yourself — the topbar view binds the resolved channel for you.

The channel name is derived from the notifiable's class FQCN by default:

Notifiable Channel
App\Models\User with id 1 App.Models.User.1
App\Models\Reseller with id 5 App.Models.Reseller.5
App\Models\Employee with id 9 App.Models.Employee.9

This matches Laravel's built-in Notifiable::receivesBroadcastNotificationsOn() convention, so no custom routing is needed on the broadcaster.


Configuration

config/beacon.php


Config Options Explained

Views

Override the inbox and per-item Blade templates.

The topbar view is the Livewire view (beacon::livewire.topbar) — publish it with php artisan vendor:publish --tag=beacon-views and edit resources/views/vendor/beacon/livewire/topbar.blade.php if you want to customize it.


Topbar

Option Description
limit notifications shown in dropdown

Realtime

Option Description
enabled Enable Echo listening
resolver FQCN that resolves the broadcast channel for a given notifiable (see Custom Channel Resolver)
channel_pattern Default pattern used by DefaultChannelResolver. {class} is replaced with the FQCN (\\.); {id} with the key
channels Per-class overrides keyed by FQCN. Wins over channel_pattern when the notifiable matches
browser_event Event fired in the browser

Per-class override example


Custom Channel Resolver

Beacon resolves the broadcast channel server-side for the notifiable that the topbar/inbox is rendered for, then ships the channel name to the frontend through the Livewire props. The browser never has to figure out the channel name — and you can derive the channel from anything you have access to in PHP (tenant, organization, custom user key, etc.).

1. Implement the contract

Return null when there is no notifiable; the frontend will skip Echo binding cleanly.

2. Point the config at it

The resolver is a string FQCN, so php artisan config:cache continues to work.

3. That's it

The package's topbar view receives the resolved channel as a Livewire prop and passes it to window.beaconTopbarBind(channel, eventName) automatically. You do not need to call beaconTopbarBind from your own app.js.


Customizing UI

Publish views:

Then edit:

You can redesign everything.


Browser Events

Beacon dispatches:

Example:

When multiple topbars are mounted (different notifiables), each one binds its own private channel and fires the same event — e.detail carries the notification payload as it arrived from Echo.


Testing Notifications

Open two tabs → watch realtime.


Use Cases


Contributing

PRs welcome.


License

MIT


Author

Built with ❤️ for Laravel ecosystem.


All versions of laravel-beacon with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/notifications Version ^10.0|^11.0|^12.0|^13.0
livewire/livewire Version ^3.0|^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rohitshakya/laravel-beacon contains the following files

Loading the files please wait ...