Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Nakov's avatar
Nakov
Best Answer
Level 73

@chron and do you use PayPal on every page in your project?

If not then consider including it just when you need, it does not have to be in the master page. In your master template just add

@yield('scripts') 

Then in the view that you want to use PayPal just include it

@section('scripts')
<script src="https://www.paypal.com/sdk/js">
@endsection 

Otherwise your all.js file will become very heavy, and having it on pages where you don't need it is a bit of an overkill I think.

jlrdw's avatar

@chron you realize by using the script like that, all you've done is go back to Step One and actually follow the API instructions.

Previous

Please or to participate in this conversation.