Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blade statement doesn't render to html code #83

Open
mgaratemu opened this issue Jan 13, 2022 · 3 comments
Open

Blade statement doesn't render to html code #83

mgaratemu opened this issue Jan 13, 2022 · 3 comments

Comments

@mgaratemu
Copy link

I create this variable on the controller:

$shareComponent = Share::page('http://jorenvanhocht.be') ->facebook() ->twitter() ->linkedin() ->reddit();

I send the $shareComponent to a view, and I tried the {!! $shareComponent !!} but instead of print it like this:

<ul>
	<li><a href="https://www.facebook.com/sharer/sharer.php?u=http://jorenvanhocht.be" class="social-button " id=""><span class="fa fa-facebook-official"></span></a></li>
	<li><a href="https://twitter.com/intent/tweet?text=my share text&amp;url=http://jorenvanhocht.be" class="social-button " id=""><span class="fa fa-twitter"></span></a></li>
	<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://jorenvanhocht.be&amp;title=my share text&amp;summary=dit is de linkedin summary" class="social-button " id=""><span class="fa fa-linkedin"></span></a></li>
	<li><a href="https://wa.me/?text=http://jorenvanhocht.be" class="social-button " id=""><span class="fa fa-whatsapp"></span></a></li>    
</ul>

the output in the template is, literally a text:

laravel-share::laravel-share-fa5.facebooklaravel-share::laravel-share-fa5.twitterlaravel-share::laravel-share-fa5.linkedinlaravel-share::laravel-share-fa5.reddit

And no more, it doesn't show the icons or the urls, nothing.

How can I solve this problem? Its a issue?

This is what I have in my compose.json:

"require": {
"php": "^8.0",
"biscolab/laravel-recaptcha": "^5.0",
"dbfx/laravel-strapi": "^1.0",
"doctrine/dbal": "^3.1.1",
"facade/ignition": "^2.3.6",
"fideloper/proxy": "^4.0",
"freshwork/chilean-bundle": "^2.1",
"grkamil/laravel-telegram-logging": "^1.7",
"guzzlehttp/guzzle": "^7.0.1",
"jorenvanhocht/laravel-share": "^4.1",
"laravel/framework": "^8.52.0",
"laravel/tinker": "^2.6.1",
"laravel/ui": "^3.0",
"league/flysystem-aws-s3-v3": "~1.0",
"malahierba-lab/chile-rut": "5.1.*",
"mehradsadeghi/laravel-filter-querystring": "^1.1",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.0",
"sentry/sentry-laravel": "^2.7",
"spatie/laravel-markdown": "^2.1",
"transbank/transbank-sdk": "^2.0",
"vinkla/hashids": "^9.1",
"zgabievi/promocodes": "^8.1"
},

@mgaratemu mgaratemu changed the title Balde statement doesn't render to html code Blade statement doesn't render to html code Jan 13, 2022
@JD456976
Copy link

Same here:

<div id="social-links"><ul><li><a href="https://twitter.com/intent/tweet?text=Your+share+text+can+be+placed+here&url=http://jorenvanhocht.be" class="social-button " id="" title="" rel=""><span class="fab fa-twitter"></span></a></li></ul></div>

@ap0ca
Copy link

ap0ca commented Jan 23, 2022

If you want just icons, add font-awesome library
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/css/all.min.css" />
If you also want to add text, change published vendor translation file
resources/lang/vendor/laravel-share/en/laravel-share-fa5.php

@kudashevs
Copy link
Contributor

the output in the template is, literally a text:

laravel-share::laravel-share-fa5.facebooklaravel-share::laravel-share-fa5.twitterlaravel-share::laravel-share-fa5.linkedinlaravel-share::laravel-share-fa5.reddit

And no more, it doesn't show the icons or the urls, nothing.

It seems like you don't have the en locale in your config settings. Under the hood this package uses trans() Laravel helper. Your output shows that it cannot find the substitution, so it returns the provided/given keys. Check your config/app.php the locale and fallback_locale values. If they don't contain en you need to publish the package config & resource files (see README.md) and then rename the folder resources/lang/vendor/laravel-share/en to something else, according to your configuration.

Hope it will help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants