Filament Custom Page always shows admin panel navigation

Filament Custom Page 'ListProductSellers' in my Buyer Panel always shows results with Admin panel sidebar navigation. My expectation is to show results with the Buyer Panel sidebar navigation.

This page is not associated with any resource. I am defining its route in web.php.

Route::get('/buyer/{product}/{key}/sellers', ListProductSellers::class)->name('buyer.product.sellers');


In my ListProductSellers class, I have a table for an Eloquent relationship. I am calling this Custom Page from another livewire component blade file using a filament link.

<x-filament::link :href="route('buyer.product.sellers', ['product' => $product,'key' => $product->id])">
      <span class="text-xs font-medium uppercase text-gray-500 dark:text-gray-500">  View Sellers</span>
 </x-filament::link>


I have attached my ListProductSeller class code. Please let me know where I am wrong.
Solution
Bingo. I got it working. Debugging shows that whenever a Filament Custom Page gets called from anywhere as a URL, the URL parameters passed by the caller are not used for automatically Initialise using the mount('ID or entire Instance as parameter') method in the Filament Custom Page class.

URL parameters are present in a Filament Custom Page as a Super Global Variable which can be assessed
Using $_GET[‘one_of the_url_parameters] // You can pass ID as a parameter.

Do not create route in web.php for Filament Custom Pages if used for logged-in users. Initialise using mount() like below:

public Product $product;
    public $productId;
    public function mount(): void
    {
        $this->productId = $_GET['productID'];
        $this->product = Product::find($this->productId);
    }


//mount($productID) // does not work or initialise.

Sharing my entire code in the attachment. This is applicable anywhere wherever one wants to call the Custom Filament Page from a URL
Was this page helpful?