Skip to content

Commit

Permalink
fix(readme update): Updated Readme with Setup Instructions and Screen…
Browse files Browse the repository at this point in the history
…shots

Updated Readme
  • Loading branch information
Dulajdeshan authored Oct 21, 2023
2 parents a50e9ee + a51e49f commit 65da9c8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 27 deletions.
43 changes: 16 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,24 @@ yarn add strapi-advanced-uuid

## Usage

Once the plugin is installed, you can add a new custom type to your Strapi content types, no configuration needed. The custom type uses the Strapi UID structure, ensuring that each UUID generated is unique.

You can create new records via the Admin panel, API or GraphQL, and the plugin will automatically generate a UUID for each new record created.

## Example

Here's an example of how to use the Strapi Auto UUID Plugin:

1. Install the plugin using `npm install strapi-advanced-uuid`
2. Create a new Strapi model with the custom type `advancedUUID`, like this:

```javascript
module.exports = {
attributes: {
title: {
type: 'string',
required: true,
},
uuid: {
type: "customField",
customField: "plugin::strapi-advanced-uuid.uuid"
},
},
};
```
### How to Setup Advanced UUID Field

After installation you will find the `Advanced UUID` at the custom fields section of the content-type builder.

![strapi advanced uuid](./screenshot/screenshot-1.png)

Now you can define the field attributes. `Advanced UUID` field allows you to define the custom regular expression (`UUID format`) for your field. Default UUID format will be [`UUID V4`](https://www.npmjs.com/package/uuid#uuidv4options-buffer-offset).

![strapi advanced uuid](./screenshot/screenshot-2.png)

### How to Use Custom Regular Expression

![strapi advanced uuid](./screenshot/screenshot-3.png)

Now You can create new records via the Admin panel, API or GraphQL, and the plugin will automatically generate a UUID for each new record created.

3. When you create a new record in this model via the Strapi API or GraphQL, the plugin will automatically generate a unique UUID for the `uuid` field.
![strapi advanced uuid](./screenshot/screenshot-4.png)

That's it! With the Strapi Advanced UUID Plugin, you can easily add UUIDs to your Strapi content without having to worry about generating them yourself.

## License
This plugin is licensed under the MIT License. See the LICENSE file for more information.
Binary file added screenshot/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 65da9c8

Please sign in to comment.