1. Add WordPress to app/vendor
Download WordPress into the vendor folder (./vendor/wordpress)
User require in composer.json, see (3).
2. Find the function location
Check the Codex page for the function you need, let's say esc_url(), as you can see in that page, the function resides in wp-includes/formatting.php
3. Include the file containg the function
Include that file, use your composer.json file then run the command composer update
"require": {
...
"johnpbloch/wordpress": "4.*"
},
"autoload": {
...
...
...
"files": [
...
"wordpress/wp-includes/formatting.php"
]
},
4. Use the function in Blade
{{-- file: app/views/example.blade.php }}
{{ esc_html( '<a href="http://www.example.com/">A link</a>' ) }}
This outputs:
<a href="http://www.example.com/">A link</a>