You should open script tag (top or end of your Blade template) and pass your data to JS script.
I usually use @stack
. Your code should be like this:
master.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>@yield('title')</title>
</head>
<body>
Blah Blah Blah
<!-- Start Content -->
@yield('content')
<!-- End Content -->
<!-- Custom Scripts -->
@stack('scripts')
</body>
</html>
chart.blade.php
@extends('master')
@section('content')
Your Page Content
@endsection
@push('scripts')
<script>
var pie = {
data: [{
name: 'Car',
y: 56.33,
sliced: true,
selected: true,
url: "{{route('dashboard')}}"
}]
};
</script>
@endpush
By this way, your data will be replaced with Laravel helper functions.