Search by

digit7s / filament-view-website

myominoo-digit7s

A lightweight Filament 5 panel plugin that adds a configurable Visit Website action to the panel topbar.

Package info

github.com/Digit7s/filament-view-website

pkg:composer/digit7s/filament-view-website

Statistics

Installs: 15

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-10-01 14:56 UTC

This package is auto-updated.

Last update: 2026-10-01 16:06:50 UTC


README

A lightweight Filament 5 panel plugin that adds a configurable “Visit Website” action to the panel topbar.

It provides a quick link from a Filament admin panel to the public website using native Filament UI. The URL, label, icon, tooltip, visibility, and new-tab behavior are configurable. The plugin requires no database tables, migrations, JavaScript, CSS, or frontend assets.

Source repository: Digit7s/filament-view-website

Latest Version on Packagist Total Downloads License

Screenshot

Filament View Website in dark mode

Features

  • Native Filament topbar integration
  • Zero-configuration defaults
  • Static or dynamic URL
  • Custom label and icon
  • Optional tooltip
  • Same-tab or new-tab navigation
  • Conditional visibility
  • No database tables or migrations
  • No custom CSS or JavaScript
  • Filament 5 support

Requirements

  • PHP ^8.2
  • Filament ^5.0

Laravel and Livewire compatibility follows Filament 5.

Installation

Install the package via Composer:

composer require digit7s/filament-view-website

Laravel package discovery registers the service provider automatically.

Usage

Register the plugin on each panel where the action should appear:

use Digit7s\FilamentViewWebsite\ViewWebsitePlugin;
use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(
            ViewWebsitePlugin::make()
        );
}

With no configuration, the plugin:

  • links to the Laravel application root (url('/'));
  • displays Visit Website;
  • uses the heroicon-o-arrow-top-right-on-square icon;
  • opens the website in a new tab; and
  • appears before the Filament user menu.

Configuration

Custom URL

Configure a static URL:

use Digit7s\FilamentViewWebsite\ViewWebsitePlugin;

ViewWebsitePlugin::make()
    ->url('https://example.com');

Dynamic URL

The URL may be provided as a closure:

ViewWebsitePlugin::make()
    ->url(fn (): string => config('app.frontend_url'));

Laravel helpers can also be used:

ViewWebsitePlugin::make()
    ->url(fn (): string => route('home'));

Custom Label

ViewWebsitePlugin::make()
    ->label('Open Website');

Custom Icon

ViewWebsitePlugin::make()
    ->icon('heroicon-o-globe-alt');

Tooltip

Set a custom tooltip:

ViewWebsitePlugin::make()
    ->tooltip('Open public website');

Disable the tooltip with ->tooltip(null).

Open in Same Tab

New-tab navigation is enabled by default. To open the website in the current tab:

ViewWebsitePlugin::make()
    ->openInNewTab(false);

Conditional Visibility

Use a boolean or closure to control whether the action is rendered:

ViewWebsitePlugin::make()
    ->visible(
        fn (): bool => auth()->user()?->can('view website') ?? false
    );

The package does not provide its own permission system; this only controls conditional rendering.

Complete Example

ViewWebsitePlugin::make()
    ->url('https://example.com')
    ->label('Visit Website')
    ->icon('heroicon-o-arrow-top-right-on-square')
    ->tooltip('Open public website')
    ->openInNewTab()
    ->visible(fn (): bool => true);

Defaults

Option Default
URL Application root (url('/'))
Label Visit Website
Icon heroicon-o-arrow-top-right-on-square
Tooltip Open public website
New tab Enabled
Visible Yes
Position Before the user menu

If the resolved URL is blank, the action is not rendered.

The plugin uses native Filament components, so it follows the panel's styling and dark mode. No custom CSS or JavaScript is required.

Screenshots

The same integration is also available in light mode and on narrow screens:

Filament View Website in light mode

Filament View Website on a mobile viewport

Testing

Run the package checks from the repository directory:

composer test
composer lint
composer test:lint
composer analyse
composer validate --no-check-publish

Security

Please do not report security vulnerabilities through public GitHub issues. See SECURITY.md for reporting instructions.

Changelog

See CHANGELOG.md for release history.

Contributing

Contributions are welcome. Please open an issue or pull request on GitHub.

Credits

License

The MIT License (MIT). Please see LICENSE.md for more information.