In the documentation it uses @yield('content') and @section('content') as an example, but the idea is the same https://laravel.com/docs/5.7/blade#template-inheritance. Just instead of doing this:
views/layouts/app.blade.php
<html>
<head>
<title>App Name - @yield('title')</title>
</head>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
views/child.blade.php
@section('content')
<p>This is my body content.</p>
@endsection
You should add the scripts tag to render the javascript. Like this:
views/layouts/app.blade.php
<html>
<head>
<title>App Name - @yield('title')</title>
</head>
<body>
@section('sidebar')
This is the master sidebar.
@show
@yield('scripts')
</body>
</html>
views/child.blade.php
@section('scripts')
<script>
$( document ).ready(function() {
console.log( "document loaded" );
});
</script>
@endsection