Insert a config value into Blade view in Laravel 5.4

13,191

I was executing that code from a VUE file. Of course it will never work

Share:
13,191
jigarzon
Author by

jigarzon

Full-stack developer with 20 years of experience mostly in blockchain technologies, vue.js, react, angular, java, php, database.

Updated on June 07, 2022

Comments

  • jigarzon
    jigarzon almost 2 years

    I want to insert a Laravel config value into a view (more precisely, into a JavaScript variable inside a Vue template).

    I' trying:

    var BOSH_SERVICE = "<?php echo config('app.boshurl') ?>";
    

    And

    var BOSH_SERVICE = "{{ config('app.boshurl') }}";
    

    But none of these works.