Answer the question
In order to leave comments, you need to log in
Why does laravel throw an error when using double brackets ({{}} )?
When working with vue.js in laravel, an error appears:
Use of undefined constant message - assumed 'message' (this will throw an Error in a future version of PHP) (View: /home/vagrant/Code/mysite/resources/views/welcome.blade.php)
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<title>Vue</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
</head>
<body>
<div id="app">
{{ message }}
</div>
<script>
var app = new Vue({
el: '#app',
data: {
message: 'Привет, Vue!'
}
})
</script>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question