Multi-tenancy by subdomain

Hi. I tried to do multi-tenancy but failed. Is there any easy way to switch between tenancy subdomain, not by url? Example:
Currently url to get tenancy: http://app.local/panel/workspace
Expected: http://workspace.app.local/panel
I tried use function domain in panel (->domain('{tenancy:slug}.app.local')) but it doesn't work
Was this page helpful?