Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Posible problems with relative routes #177

Open
Edgarborras94 opened this issue Aug 10, 2020 · 3 comments
Open

Posible problems with relative routes #177

Edgarborras94 opened this issue Aug 10, 2020 · 3 comments

Comments

@Edgarborras94
Copy link
Contributor

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?

@Bottelet
Copy link
Owner

No please do, always looking for improvements, a better solution might be too use named routed `{{route('name')}} what's your thought?

@Edgarborras94
Copy link
Contributor Author

Sure!! I will collect all the relative url and then look for all the named routes 😉

@RikvanderVaart
Copy link

RikvanderVaart commented Jul 28, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants