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

Commit 0d2165a

Browse files
committed
Update README
1 parent 45ba9e2 commit 0d2165a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
# Laravel JS routes
2+
23
Command for use Laravel routes in JS
34

45
### Usage:
56

6-
```
7+
```shell
78
composer require halivert/laravel-js-routes
89
```
910

11+
Execute artisan command
12+
13+
```shell
14+
php artisan route:tojs
15+
```
16+
1017
Add the resource to webpack.mix.js:
18+
1119
```js
1220
mix.js("resources/js/routes", "public/js");
1321
```
1422

1523
And to use it, you need to import it
24+
1625
```js
1726
import { route } from "./routes.js";
1827
```
1928

20-
And voila! you can have the ```route``` function, the first parameter is the route name (same as in laravel)
21-
and the second is an array of parameters.
29+
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.

0 commit comments

Comments
 (0)