RasmusGP
RasmusGP
FFilament
Created by RasmusGP on 5/7/2024 in #❓┊help
CustomPage for related model
So I have done the following: - Blade Template: I created chat.blade.php at resources/views/filament/app/pages/chat.blade.php for displaying messages and a send button:
<x-filament-panels::page>
<div>
<div><h2>Title</h2></div>
<div>Messages container</div>
<div><input type="text"/><button>Send</button></div>
</div>
</x-filament-panels::page>
<x-filament-panels::page>
<div>
<div><h2>Title</h2></div>
<div>Messages container</div>
<div><input type="text"/><button>Send</button></div>
</div>
</x-filament-panels::page>
- Tenant-Specific Route: Configured within app/Providers/Filament/AppPanelProvider.php
public function panel(Panel $panel): Panel
{
return $panel
... Other functions
->tenantRoutes(function ($router) {
Route::get('/tenancies/{record}/conversation', [Conversation::class, 'mount'])->name('filament.app.tenancies.conversation');
})
...
Other functions
public function panel(Panel $panel): Panel
{
return $panel
... Other functions
->tenantRoutes(function ($router) {
Route::get('/tenancies/{record}/conversation', [Conversation::class, 'mount'])->name('filament.app.tenancies.conversation');
})
...
Other functions
- Custom Page: Defined in app/Filament/App/Resources/TenancyResource/Pages/Conversation.php to load the conversation:
class Conversation extends Page
{
use InteractsWithRecord;

protected static ?string $slug = 'conversation/{id}';
protected static bool $shouldRegisterNavigation = false;

public function mount(int | string $record, Tenancy $tenancy): void
{
// $tenancy = (new Tenancy)->findOrFail($record);
$conversation = $tenancy->conversation;
$this->record = $conversation;
}

protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'filament.app.pages.chat'; // Points to blade component
}
class Conversation extends Page
{
use InteractsWithRecord;

protected static ?string $slug = 'conversation/{id}';
protected static bool $shouldRegisterNavigation = false;

public function mount(int | string $record, Tenancy $tenancy): void
{
// $tenancy = (new Tenancy)->findOrFail($record);
$conversation = $tenancy->conversation;
$this->record = $conversation;
}

protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'filament.app.pages.chat'; // Points to blade component
}
Despite these setups, accessing app/{tenant}/tenancies/{record}/conversation only shows a white screen, with no errors logged. Could this be an issue with how I'm implementing Filament for non-standard use cases, or am I missing something in my configuration? Any guidance would be appreciated.
3 replies