Skip to content

Commit

Permalink
update docs and add photo for example
Browse files Browse the repository at this point in the history
  • Loading branch information
m-triassi committed Jul 9, 2019
1 parent d4bfab8 commit 2c38651
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,21 @@ You can change the default "Add layout" button's text like so:
Flexible::make('Content')
->button('Add something amazing!');
```

![Add something amazing](https://github.com/whitecube/nova-flexible-content/raw/master/add_something_amazing.png)

#### Limiting layouts

You can limit how many times the "Add Layout" button will appear by doing the following

```php
Flexible::make('Content')
->limit(2);
```

You can specify any integer, or no integer at all; in that case it will default to 1.

![Limit added layouts](https://github.com/whitecube/nova-flexible-content/raw/master/limit_added_layouts.png)

## Custom Layout Classes

Sometimes, `addLayout` definitions can get quite long, or maybe you want them to be shared with other `Flexible` fields. The answer to this is to extract your Layout into its own class.
Expand Down
Binary file added limit_added_layouts.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 2c38651

Please sign in to comment.