Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 7a11fbd

Browse files
committed
Add absolute url option.
Usage in README.md.
1 parent 01fadac commit 7a11fbd

File tree

3 files changed

+607
-398
lines changed

3 files changed

+607
-398
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ Add the resource to webpack.mix.js:
2020
mix.js("resources/js/routes", "public/js");
2121
```
2222

23+
If you want to use absolute urls, you need to have `MIX_APP_URL` .env var
24+
2325
And to use it, you need to import it
2426

2527
```js
2628
import { route } from "./routes.js";
2729
```
2830

2931
And voila! you can have the `route` function, the first parameter is the route
30-
name (same as in laravel) and the second is an array of parameters.
32+
name (same as in laravel), the second is an array of parameters or an object,
33+
and the third is if you want to use absolute paths, by default true.
3134

3235
## License
3336
[MIT](https://github.com/halivert/laravel-js-routes/blob/master/LICENSE)

0 commit comments

Comments
 (0)