F
Filament10mo ago
Wazza

Custom page adding to tabs

Hey all you smart people, I'm having a little issue and was wondering if anyone could help me, I need to make a custom page which I have done and created the page inside my OrganisationResource However I want to be able to navigate to that page on some tabs that I've got as you can see in that Image ive provided, the other tabs are relationship managers but I would like to be able to show a custom form on that tab belows is my OrganisationResource
public static function getRelations(): array
{
return [
RelationManagers\OrganisationRelationManager::class,
RelationManagers\UsersRelationManager::class,
RelationManagers\TeamsRelationManager::class,
RelationManagers\CallsRelationManager::class,
RelationManagers\AnalyticsRelationManager::class,
];
}

public static function getPages(): array
{
return [
'index' => Pages\ListOrganisations::route('/'),
'create' => Pages\CreateOrganisation::route('/create'),
'edit' => Pages\EditOrganisation::route('/{record}/edit'),
'view' => Pages\ViewOrganisation::route('/{record}'),
'call-rules' => Pages\CallRules::route('/{record}/call-rules'),
];
}
public static function getRelations(): array
{
return [
RelationManagers\OrganisationRelationManager::class,
RelationManagers\UsersRelationManager::class,
RelationManagers\TeamsRelationManager::class,
RelationManagers\CallsRelationManager::class,
RelationManagers\AnalyticsRelationManager::class,
];
}

public static function getPages(): array
{
return [
'index' => Pages\ListOrganisations::route('/'),
'create' => Pages\CreateOrganisation::route('/create'),
'edit' => Pages\EditOrganisation::route('/{record}/edit'),
'view' => Pages\ViewOrganisation::route('/{record}'),
'call-rules' => Pages\CallRules::route('/{record}/call-rules'),
];
}
The page I want to add to the tab is the call-rules, here is my custom page code
<?php

namespace App\Filament\Resources\OrganisationResource\Pages;

use App\Filament\Resources\OrganisationResource;
use Filament\Resources\Pages\Page;
use Filament\Resources\Pages\Concerns\InteractsWithRecord;

class CallRules extends Page
{
use InteractsWithRecord;

protected static string $resource = OrganisationResource::class;

protected static string $view = 'filament.resources.organisation-resource.pages.call-rules';

public function mount(int | string $record): void
{
$this->record = $this->resolveRecord($record);
}
}
<?php

namespace App\Filament\Resources\OrganisationResource\Pages;

use App\Filament\Resources\OrganisationResource;
use Filament\Resources\Pages\Page;
use Filament\Resources\Pages\Concerns\InteractsWithRecord;

class CallRules extends Page
{
use InteractsWithRecord;

protected static string $resource = OrganisationResource::class;

protected static string $view = 'filament.resources.organisation-resource.pages.call-rules';

public function mount(int | string $record): void
{
$this->record = $this->resolveRecord($record);
}
}
Any help would be great ❤️ Thanks Wazza
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server