ViewResource incorrect url generated
I have My resource and after specific condition is met the canEdit function in Resource returns false and then i want to redirect user to ViewResouce. I have a table action for it:
Action::make('link')
->url(fn(Model $record) => self::getUrl('view', ['record' => $record]))->openUrlInNewTab()
->label('Show'),
but it won't redirect to the correct resource - it adds a $_GET parameters and the url looks like /resource/%7Brecord?record=1 instead of /resource/1.
Am i missing something here ?
1 Reply
Solution
Typo in view route declaration, had '/{record' (missing })