Record variable type change to string if i add the mount function on my viewrecord page
Hi, i'm trying to add an additional viewRecord page on my resource to show some info in an specific type of records. If the record doen't have this specific type, i need to block accessing the page throwing a 404 error.
So i'm trying to make a validation on the mount hook of this page. The problem is with the record. If I don't add the mount function, the $this->record is a Model of my record, but when I add the mount function, it it's a string, the name of the record.
Solution:Jump to solution
Hi, you should ideally try and inspect the extended class. which would showm you can do:
```php
public function mount(int | string $record): void
{...
3 Replies