2

I need to connect some files, using csrf_token (from laravel), but i have unknown errors such as:

  • <link rel="stylesheet" href="{{ asset('css/app.css) }}">
    syntax error, unexpected ''css/app.css)); ?>">' (T_ENCAPSED_AND_WHITESPACE)
  • <script> var BASE_URL = '{{ URL::to('/') }}'; </script>
    syntax error, unexpected '?'
  • <script src="{{ asset('js/app.js') }}"></script>
    syntax error, unexpected 'js' (T_STRING), expecting ')'

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf-token" content="{{ csrf_token() }}">

        <title>Auth</title>

        <link rel="stylesheet" href="{{ asset('css/app.css) }}">

    </head>
    <body>
        <div id="app"></div>

        <script>
            var BASE_URL = '{{ URL::to('/') }}';
        </script>

        <script src="{{ asset('js/app.js') }}"></script>
    </body>
</html>

2 Answers 2

3

You have missed a quote

instead of

<link rel="stylesheet" href="{{ asset('css/app.css) }}">

use

<link rel="stylesheet" href="{{ asset('css/app.css') }}">
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, i probably need to go to bed)
2

For second, instead of

var BASE_URL = '{{ URL::to('/') }}';

use

var BASE_URL = "{{ URL::to('/') }}";

2 Comments

Thank you very much
While the 2nd is much easier to read, both of these actually work in .blade.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.