There is a beautiful trick to make this happen with Laravel.
First, you need to specify
For example, we have this blade files structure:
/views/main.blade.php, the wrapper for our pages
// views/partials/single.blade.php @extends('main') @push('scripts') <script defer src="https://unpkg.com/@alpinejs/[email protected]/dist/cdn.min.js"></script> @endpush @section('content') ... @endsection