You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am on laravel 9 in my show blade I am trying to display any URL posted by a user here is my code
in my livewire post show blade I did this if I create a post with a link the is not previewing in my show view page , I have tried to different URL still not working
public function mount (Post $post)
{
$this->post = $post;
preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $post->body, $matches);
$this->urlDetails = collect($matches[0])->map(function ($url) {
$embed = new Embed();
$info = $embed->get($url);
return ['info' => $info, 'title' => $info->title];
})->all();
}
getting the URL like this in my show blade view
{{ $urlDetails['title'] ?? '' }}
but it's not working
The text was updated successfully, but these errors were encountered:
I am on laravel 9 in my show blade I am trying to display any URL posted by a user here is my code
in my livewire post show blade I did this if I create a post with a link the is not previewing in my show view page , I have tried to different URL still not working
getting the URL like this in my show blade view
but it's not working
The text was updated successfully, but these errors were encountered: