Laravel 5 url :: asset () not showing in view

In my app.blade.php (master template) I have a section called @yield('scripts')

, located at the bottom of the page, like this:

    <html>
    <header>...</header>
    <body>

       ....
       <script src="{{ URL::asset('js/bootstrap.min.js')}}"></script>
       <script src="{{ URL::asset('js/site.js')}}"></script>
       @yield('scripts')
   </body>
   </html>

      

I have a view called index.blade.php that links to the previous section to add some scripts that are only used in this view like this:

  @section('scripts')

   <script src="{{ URL::asset('js/moment.js') }}"></script>
   <script src="{{ URL::asset('js/pikaday.js') }}"></script>

  @endsection

      

However, I noticed that the path for the first script that is declared js/moment.js

does not display correctly when viewing the source. For some strange reason, its display looks like this:

<script src="{{ URL::asset('js/moment.js')); ?>">
<script src="http://localhost:8000/js/pikaday.js"> 

      

I know the script is in the right place, and when I add a new script to the declaration above it, it seems like it looks great, but the first script always displays incorrectly. When I state the following:

  @section('scripts')

    <script src="{{ URL::asset('js/moment.js') }}"></script>
   <script src="{{ URL::asset('js/moment.js') }}"></script>
   <script src="{{ URL::asset('js/pikaday.js') }}"></script>

  @endsection

      

I am getting the following output:

 <script src="{{ URL::asset('js/moment.js')); ?>">
 <script src="http://localhost:8000/js/moment.js">
 <script src="http://localhost:8000/js/pikaday.js">

      

Does anyone know what's going on here?

+3
url php path laravel-5


source to share


No one has answered this question yet

Check out similar questions:

4622
What is the maximum URL length in different browsers?
4193
What is the difference between URI, URL and URN?
3419
How do I change the URI (URL) for a remote Git repository?
2853
Get the current url using JavaScript?
2366
Encode url in JavaScript?
2170
How can I change the url without reloading the page?
1690
Get current url using jQuery?
1260
How can I open the url in the Android browser from my application?
1168
Path.Combine for URLs?
978
Get full url in PHP



All Articles
Loading...
X
Show
Funny
Dev
Pics