this is my problem for a long year. every time I deployed the project always I add public sub directory to the css / images / JavaScript to the links. i will demonstrate here on the below the comparison.
Question: Is there way not to put the sub directory of public.?
Localhost VS Deployed project on apache.
Localhost:
<script src="{{asset('js/jquery.min.js')}}" crossorigin="anonymous"></script>
<link href="{{ asset('datatables/dataTables.bootstrap4.min.css') }}" rel="stylesheet">
<img src="{{asset('storage/'.Auth::user()->profile_image)}}" class="img-profile rounded-circle" style="width:40px !important; height:40px !important;">
Production:
<script src="{{asset('/public/js/jquery.min.js')}}" crossorigin="anonymous"></script>
<link href="{{ asset('/public/datatables/dataTables.bootstrap4.min.css') }}" rel="stylesheet">
<img src="{{asset('/public/storage/'.Auth::user()->profile_image)}}" class="img-profile rounded-circle" style="width:40px !important; height:40px !important;">
Thank you.