How to do getUrl() but another panel?

So I have a customer panel and after they create their order, i have a code that is like this (in the create() method of the Customer Panel CreateOrder class
# CreateOrder class
namespace App\Filament\Customer\Resources\OrderResource\Pages;

use App\Filament\Resources\OrderResource as AdminOrderResource;
use Filament\Notifications\Notification;

$admins = Admin::get();

Notification::make()
->title('New Order')
->success()
->actions([
Action::make('view')
->button()
->url(AdminOrderResource::getUrl('edit', ['record' => $order->id])),
])
->sendToDatabase($admins, true);
# CreateOrder class
namespace App\Filament\Customer\Resources\OrderResource\Pages;

use App\Filament\Resources\OrderResource as AdminOrderResource;
use Filament\Notifications\Notification;

$admins = Admin::get();

Notification::make()
->title('New Order')
->success()
->actions([
Action::make('view')
->button()
->url(AdminOrderResource::getUrl('edit', ['record' => $order->id])),
])
->sendToDatabase($admins, true);
However i get this error instead when i tried creating the order Route [filament.customer.resources.orders.edit] not defined. But clearly I made sure i call the getUrl() method on the OrderResource that is from the Admin panel (even giving it an alias of AdminOrderResource), and not the Customer panel.
5 Replies
Dennis Koch
Dennis Koch16mo ago
I don’t think you can as the other panel is not registered.
pocket.racer
pocket.racerOP16mo ago
but i can access both panel url so isn't that registered
Dennis Koch
Dennis Koch16mo ago
The panel is probably registered. But the resources and pages are not 🤔
pocket.racer
pocket.racerOP16mo ago
i can access both resource page too (in different panel)
Dennis Koch
Dennis Koch16mo ago
Yes but not at the same time. It depends on your url
Want results from more Discord servers?
Add your server