Skip to content

Instantly share code, notes, and snippets.

@radermacher
Last active July 28, 2023 14:13
Show Gist options
  • Save radermacher/28c223cb350ba3d0659b1a125e358f5c to your computer and use it in GitHub Desktop.
Save radermacher/28c223cb350ba3d0659b1a125e358f5c to your computer and use it in GitHub Desktop.
NativePHP External Link Livewire Component #nativephp #livewire
@radermacher
Copy link
Author

radermacher commented Jul 28, 2023

Or you can use JavaScript directly in your view to open an external link in the user's default browser:

<a 
    href="https://www.google.com/"
    onclick="require('electron').shell.openExternal(this.href); return false;" 
>
    Label
</a>

This solution based on Mark Beech comment:
https://twitter.com/JayBird1979/status/1684919646925795330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment