Use asset helper function like below:
<script src="{{ asset('/assets/js/jquery-2.1.1.min.js') }}"></script> will get
<script src="http://xxx.xxx.com/assets/js/jquery-2.1.1.min.js"></script> Is there any laravel build-in solutions can let it be
<script src="//xxx.xxx.com/assets/js/jquery-2.1.1.min.js"></script> and properly display with http and https protocols?
[EDIT]
I know that Laravel normally detects the protocol correctly, but when behind a load balancer, it does not. So I'm still looking for a solution to this.
assethelper has a second argument$secure? That means{{ asset('/assets/js/jquery-2.1.1.min.js', true) }}should give you want you want, if you know the protocol needs to be https.