Closed lukeptchr closed 1 year ago
You can bind your own Asset class to the contract in your service provider, but yes that could definitely be made simpler with a config.
You could PR the config, then bind it like we do for entries: https://github.com/statamic/eloquent-driver/blob/master/src/ServiceProvider.php#L181-L183
Then use that bound value in the AssetRepository.
Yes I have the PR already ready locally. But this will be a breaking change since this will require the config file change.
It wouldnt be a breaking change if you specify the current default when using config() ?
Of course, smart move!
Are you still planning on opening a PR for this @lukeptchr ?
I've opened a PR for this over here
I'm sorry, I just saw this. Thanks for opening the PR!
I came to a situation where I need to override the
shallowAugmentedArrayKeys
of the Asset. But there is no possibility to override the Asset class.This is possible for Entries in
eloquent-driver.php
config file ->entries.entry
.So I suggest to add
assets.asset
ineloquent-driver.php
.And then change
Statamic\Eloquent\Assets\AssetRepository
fromAssetContract::class => Asset::class,
To
AssetContract::class => config('statamic.eloquent-driver.assets.asset'),