Skip to content

Commit 0c54d90

Browse files
committed
docs: use named parameters in code examples
1 parent 4082852 commit 0c54d90

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

docs/pages/getting-started.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,32 @@ use AceOfAces\LaravelImageTransformUrl\Facades\ImageTransformUrl;
3434

3535
// Generate a URL with array options
3636
$url = ImageTransformUrl::make(
37-
'foo/example.jpg',
38-
['width' => 250, 'quality' => 80, 'format' => 'webp'],
39-
'images'
37+
path: 'foo/example.jpg',
38+
options: ['width' => 250, 'quality' => 80, 'format' => 'webp'],
39+
pathPrefix: 'images'
4040
);
4141

4242
// Generate a URL with string options
4343
$url = ImageTransformUrl::make(
44-
'foo/example.jpg',
45-
'width=250,quality=80,format=webp',
46-
'images'
44+
path: 'foo/example.jpg',
45+
options: 'width=250,quality=80,format=webp',
46+
pathPrefix: 'images'
4747
);
4848

49-
// Use default source directory (omit the third parameter)
49+
// Use default source directory (omit the pathPrefix parameter)
5050
$url = ImageTransformUrl::make(
51-
'foo/example.jpg',
52-
['width' => 250, 'quality' => 80]
51+
path: 'foo/example.jpg',
52+
options: ['width' => 250, 'quality' => 80]
5353
);
5454
```
5555

5656
The `url()` method is also available as an alias for `make()`:
5757

5858
```php
59-
$url = ImageTransformUrl::url('img/example.jpg', ['width' => 250]);
59+
$url = ImageTransformUrl::url(
60+
path: 'img/example.jpg',
61+
options: ['width' => 250]
62+
);
6063
```
6164

6265
::: info

docs/pages/signed-urls.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ $options = [
6969
];
7070

7171
$temporarySignedUrl = ImageTransformUrl::temporarySignedUrl(
72-
'example.jpg',
73-
$options,
74-
now()->addMinutes(60),
75-
'protected'
72+
path: 'example.jpg',
73+
options: $options,
74+
expiration: now()->addMinutes(60),
75+
pathPrefix: 'protected'
7676
);
7777
```
7878

0 commit comments

Comments
 (0)