Filament Menu "Paywall": Show Items but Restrict Access

Filament 4/5

Demonstrates how to have "premium" menu items which are shown on the sidebar but lead to "locked" pages with buttons to pay for premium.

Untitled design (3)

Get the Source Code:

Only This Example

$9

One-time payment

Full source code for Filament Menu "Paywall": Show Items but Restrict Access
Downloadable ZIP file with the source code
Lifetime access to this example
GitHub Sign in with GitHub to buy

Sign in first, then complete your $9 checkout.

Best value — all 169 examples

FilamentExamples Membership

$99 /year
or
$199 lifetime
Access to code of all 169 examples
Future new examples and updates included
FilaCheck Pro package licence included
MCP server included
View membership plans

30-day money-back guarantee

How it works

It's inspired by a question on the official Filament Discord:

So, this project shows four Filament Resources:

  • Tasks (free)
  • Projects, Tags, Categories (paid)

Notice 1: The project doesn't implement the payments/subscriptions. It's simplified and focused on just menu items show/hide, using just users.is_subscribed DB column.

Notice 2: those resources are also "placeholders", without any DB data or Filament columns/inputs, just to show the situation.

If a non-subscribed user clicks on any Paid resource, they are redirected to the speficic Locked page, with the resource as a part of the URL, for future redirect after the payment.

To check each page for access, there's a global SubscriptionMiddleware assigned to all Filament routes.

app/Http/Middleware/SubscriptionMiddleware.php:

class SubscriptionMiddleware
{
private array $paidResources = [
'tags',
'projects',
'categories',
];
 
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (!auth()->user()->is_subscribed) {
// ...
The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.