Skip to content

How to open a link? #173

Closed Answered by MasterRO94
MasterRO94 asked this question in Q&A
Aug 11, 2023 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

Found a solution.

NativePHP has Shell helper class. So to open an external url you can call Shell::openExternal($url)

Full example

<a
  class="block w-20 h-6 bg-blue-500 rounded-lg text-center text-white hover:bg-blue-400"
  href="#!"
  wire:click.prevent="openExternal('{{ $meeting->url }}')"
 >
   Join
</a>
use Native\Laravel\Facades\Shell;

// 

public function openExternal(string $url): void
{
    Shell::openExternal($url);
}

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@MasterRO94
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MasterRO94
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants