Skip to content

Commit

Permalink
Fix: Hide page urls when routing disabled (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Z3d0X authored Nov 13, 2022
1 parent e1e703d commit e9b8a15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Resources/PageResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static function form(Form $form): Form
Card::make()
->schema([
Placeholder::make('page_url')
->visible(fn (?PageContract $record) => filled($record))
->visible(fn (?PageContract $record) => config('filament-fabricator.routing.enabled') && filled($record))
->content(fn (?PageContract $record) => config('filament-fabricator.routing.prefix') . FilamentFabricator::getPageUrlFromId($record?->id, true)),

TextInput::make('title')
Expand Down Expand Up @@ -136,7 +136,8 @@ public static function table(Table $table): Table
->label(__('filament-fabricator::page-resource.labels.url'))
->toggleable()
->getStateUsing(fn (?PageContract $record) => FilamentFabricator::getPageUrls()[$record->id] ?? null)
->url(fn (?PageContract $record) => FilamentFabricator::getPageUrls()[$record->id] ?? null),
->url(fn (?PageContract $record) => FilamentFabricator::getPageUrls()[$record->id] ?? null)
->visible(config('filament-fabricator.routing.enabled')),

BadgeColumn::make('layout')
->label(__('filament-fabricator::page-resource.labels.layout'))
Expand Down

0 comments on commit e9b8a15

Please sign in to comment.