DaybydayCRM
DaybydayCRM copied to clipboard
Posible problems with relative routes
I found some relative routes that might cause errors in certain environments.
ie: resources/views/tasks/show.blade.php
:line 269
...
$('#add-invoice-line-modal .modal-content').load('/add-invoice-lines/{{$tasks->external_id}}' + '/task');
...
Can cause errors in example on localhost routes:
expected: http://localhost/daybydaycrm/public/add-invoice-lines/id/task
what you actually get: http://localhost/add-invoice-lines/id/task
An easy solution might be using laravel URL helper:
...
$('#add-invoice-line-modal .modal-content').load('{{url('/add-invoice-lines/'.$tasks->external_id)}}' + '/task');
...
I'm trying to collect all of this routes to fix them
Should I make a PR after fixing them or is it too specific?
No please do, always looking for improvements, a better solution might be too use named routed `{{route('name')}} what's your thought?
Sure!! I will collect all the relative url and then look for all the named routes 😉
This issue still giving some problems. Especially with the calls in the ajax code. I added {{asset()}} and managed to solve most breaking links. However still some. Also the datatable for the leads is not populating. I am not to versed in jquery and ajax so left this one alone for now. Updated, fixed the datatable after I found the vue component. I added asset() after the get statement on line 88. worked as a charm.