Absolute path to Twitter share URL in Ravel

Asked 2 years ago, Updated 2 years ago, 92 views

If you put https://example.com/member/show/1 on Twitter's OGP (press the share button to share images and URLs), the URL can be skipped. The URL of Ravel does not fly well.(url={route('member.show', ['id'=>$id])} does not work.Specifically, hashtags and text are displayed, but the URL is not displayed.

<a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=share&url=https://example.com/member/show/1&hashtags=blog,share?"onclick="window.open(this.href, 'TWwindow', 'width=650, height=450, menubar=no, toolbar=no, scrollbars;">yurtles; Twitter;"

★ URL
https://example.com/member/show/1

<a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=share&url=https://example.com/member/show/1&hashtags=blog,share?"onclick="window.open(this.href, 'TWwindow', 'width=650, height=450, menubar=no, toolbar=no, scrollbars;">yurtles; Twitter;"
★ url = {{route('member.show', ['id'=>$id])}}

Could someone please let me know?

laravel twitter

2022-09-29 22:28

1 Answers

Do you have the declaration in href?

<a class="twitter-share-button" href={{route('member.show', ['id'=>$id])}onclick="window.open(this.href, 'TWwindow', 'width=650, height=450, menubar=no, tools);reverse=reverse="reversalts;"

If not, does the route have a name?

Route::get('/member/show'.'MemberController@show') ->name('member.show');

I think it's like this, but

I've never used the route as it is, so I don't know, but I think I can go with this


2022-09-29 22:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.