Skip to content

Commit dd1da63

Browse files
authored
Update README.md
1 parent 5a4d0e2 commit dd1da63

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,32 @@ No more 40 line controller methods for fetching data!
3434
3535
## Usage
3636
37+
### Make Command
38+
39+
Creating a new Inertia Data Provider is easy with the make:data-provider command.
40+
41+
#### Command:
42+
43+
```Bash
44+
php artisan make:data-provider {name}
45+
```
46+
47+
#### Arguments:
48+
49+
* `{name}`: The name of the enum class to be created (e.g., OrderStatus). The command will automatically append "Enum" to the name (e.g., OrderStatusEnum).
50+
* `{--force}`: Overwrite the data provider if it already exists.
51+
52+
#### Example Usage:
53+
54+
``` Bash
55+
php artisan make:data-provider UserProfileDataProvider
56+
```
57+
58+
This will generate a UserProfileDataProvider in the `app/Http/DataProviders` directory.
59+
60+
> [!TIP]
61+
> Using Laravel Idea? There's a "Create Inertia Data Provider" action available!
62+
3763
### Using a Data Provider
3864
Data providers take advantage of the fact that `Inertia::render` can accept an `Arrayable`.
3965
They can also be used as discrete attributes in the data array.

0 commit comments

Comments
 (0)