Comments (2)
There is Generating custom urls config for medialibrary package.
Create custom UrlGenerator
class extending Spatie\MediaLibrary\Support\UrlGenerator\BaseUrlGenerator
,
/*
* When urls to files get generated, this class will be called. Use the default
* if your files are stored locally above the site root or on s3.
*/
'url_generator' => Spatie\MediaLibrary\Support\UrlGenerator\TenantAwareUrlGenerator::class,
I think using asset helper of tenancy, something like below should work
class TenantAwareUrlGenerator extends BaseUrlGenerator
{
public function getUrl(): string
{
$url = asset($this->getPathRelativeToRoot());
$url = $this->versionUrl($url);
return $url;
}
...
}
from tenancy-docs.
@kakajansh 's answer did the trick.
But it helps notice that you'll likely have to implement these function: getTemporaryUrl
, getPath
from default URL
Generator class found in Spatie\MediaLibrary\UrlGenerator
.
[Because that is mandated by abstract class Spatie\MediaLibrary\UrlGenerator\BaseUrlGenerator
]
from tenancy-docs.
Related Issues (20)
- Caching existance of tenant database HOT 1
- [4.x] Document the pending tenants feature and the related commands HOT 3
- [4.x] Document MailTenancyBootstrapper
- [4.x] Document making broadcasting work with Tenancy
- [4.x] Document PrefixCacheTenancyBootstrapper
- Synced resources between tenants
- Point domain HOT 1
- error 404 with quickstart steps HOT 1
- Database for each domain HOT 1
- [4.x] Document UrlTenancyBootstrapper (using tenant URLs in queued emails)
- Sponsor Docs: Clarification on Nova Config Middleware HOT 1
- [4.x] Document the InitializeTenancyByRequestData payload priority
- [4.x] Livewire integration with path/request data identification
- [4.x] Postgres RLS integration
- Call to undefined method Stancl\Tenancy\Database\Models\Tenant::database() HOT 3
- Tenant attribute encryption - migration needs to have nullable columns
- [4.x] Route name prefixing and tenant parameter passing
- Not able to identify Controllers that in tenant route HOT 1
- Take action once the tenant has been created. HOT 1
- tenancy 3.7 + Laravel/Breeze 1.21. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tenancy-docs.