You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,35 @@
2
2
3
3
All notable changes to `laravel-medialibrary` will be documented in this file
4
4
5
+
## 11.16.0 - 2025-10-21
6
+
7
+
### What's Changed
8
+
9
+
* Test PHP 8.5 by @erikn69 in https://github.com/spatie/laravel-medialibrary/pull/3857
10
+
* Add Support for Defining Custom Path Generators in Models or Service Providers by @alissn in https://github.com/spatie/laravel-medialibrary/pull/3828
11
+
* Bump stefanzweifel/git-auto-commit-action from 6 to 7 by @dependabot[bot] in https://github.com/spatie/laravel-medialibrary/pull/3860
12
+
13
+
### New Contributors
14
+
15
+
*@alissn made their first contribution in https://github.com/spatie/laravel-medialibrary/pull/3828
Copy file name to clipboardExpand all lines: docs/advanced-usage/using-a-custom-directory-structure.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,31 @@ interface PathGenerator
55
55
56
56
There aren't any restrictions on how the directories can be named. When a `Media`-object gets deleted the package will delete its entire associated directory. To avoid tears or worse, make sure that every media gets stored its own unique directory.
57
57
58
+
### Model-specific Custom Path Generators
59
+
In addition to setting a global path generator in the config file, You can also define a `CustomPathGenerator` class for specific models directly inside the model's `booting()` method or within a service provider:
60
+
61
+
```php
62
+
use Spatie\MediaLibrary\Support\PathGenerator\PathGeneratorFactory;
63
+
use Spatie\MediaLibrary\Tests\Support\PathGenerator\CustomPathGenerator;
0 commit comments