Skip to content

Commit 78fc1a9

Browse files
committed
docs: update README.md with latest API changes
- Remove showPreview() references (method removed) - Update all examples to use new API - Add Display Modes section explaining all view options - Reorder methods table for better clarity
1 parent 40e45cc commit 78fc1a9

1 file changed

Lines changed: 28 additions & 11 deletions

File tree

‎README.md‎

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,13 @@ npm run dev
5959
```php
6060
use gheith3\FileViewEntryPlugin\Infolists\Components\FileViewEntry;
6161

62-
// Single file
62+
// Single file - opens in modal when clicked
6363
FileViewEntry::make('file_path')
64-
->showPreview()
6564
->downloadable();
6665

67-
// Multiple files in grid
66+
// Multiple files in grid layout
6867
FileViewEntry::make('attachments')
6968
->grid(4)
70-
->showPreview()
7169
->downloadable();
7270
```
7371

@@ -83,7 +81,6 @@ FileViewEntry::make('documents')
8381
->titleKey('title') // Default: 'name'
8482
->pathKey('path') // Default: 'file_path'
8583
->dateKey('uploaded_at') // Default: null (hidden)
86-
->showPreview()
8784
->downloadable();
8885
```
8986

@@ -97,9 +94,9 @@ FileViewEntry::make('documents')
9794
| `dateKey(?string $key)` | Key for date (null to hide) |
9895
| `asModal(bool $enabled)` | Show content in modal (default: true) |
9996
| `withModalEye(bool $enabled)` | Add eye button for modal preview when asModal(false) |
97+
| `showAsLink(bool $enabled)` | Show as compact list (default: false) |
10098
| `disk(string $disk)` | Storage disk name |
10199
| `downloadable(bool $enabled)` | Show download button |
102-
| `showAsLink(bool $enabled)` | Show as compact list with modal preview |
103100
| `previewHeight(int\|string $height)` | Modal height (default: 300px) |
104101

105102
### Grid Columns Reference
@@ -126,7 +123,6 @@ public static function infolist(Infolist $infolist): Infolist
126123
FileViewEntry::make('uploadedFiles') // relationship name
127124
->label('Attachments')
128125
->grid(6)
129-
->showPreview()
130126
->downloadable(),
131127
]);
132128
}
@@ -146,18 +142,39 @@ FileViewEntry::make('customData')
146142
->grid(2);
147143
```
148144

149-
### Display Content Inline (No Modal)
145+
### Display Modes
146+
147+
The plugin supports three display modes:
148+
149+
#### 1. Card Grid (Default)
150+
Files displayed as cards in a grid. Click to open modal.
151+
152+
```php
153+
FileViewEntry::make('attachments')
154+
->grid(4)
155+
->downloadable();
156+
```
157+
158+
#### 2. Compact List
159+
Files displayed as a simple list (icon + filename). Click to open modal.
160+
161+
```php
162+
FileViewEntry::make('attachments')
163+
->showAsLink(true) // Compact list view
164+
->downloadable();
165+
```
166+
167+
#### 3. Inline Display
168+
Files displayed directly on the page with full preview.
150169

151170
```php
152-
// Show files directly on the page instead of in a modal
153171
FileViewEntry::make('attachments')
154172
->asModal(false) // Display content inline
155173
->downloadable()
156174
->grid(2);
157175
```
158176

159-
### Inline with Modal Preview Button
160-
177+
#### 4. Inline with Modal Preview Button
161178
When using `asModal(false)`, you can add an eye button that opens a modal preview:
162179

163180
```php

0 commit comments

Comments
 (0)