Ad

Unknown Errors Using Csrf_token. Laravel

- 1 answer

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

  • <link rel="stylesheet" target="_blank" rel="nofollow noreferrer" 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" target="_blank" rel="nofollow noreferrer" 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>

Ad

Answer

You have missed a quote

instead of

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

use

<link rel="stylesheet" target="_blank" rel="nofollow noreferrer" href="{{ asset('css/app.css') }}">
Ad
source: stackoverflow.com
Ad