{"id":5730,"date":"2020-07-30T06:59:17","date_gmt":"2020-07-30T06:59:17","guid":{"rendered":"https:\/\/infyblog.zluck.in\/?p=5730"},"modified":"2025-07-17T08:50:48","modified_gmt":"2025-07-17T08:50:48","slug":"custom-path-generation-in-spatie-media-library-while-multi-tenant","status":"publish","type":"post","link":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/","title":{"rendered":"Custom path generation in Spatie Media Library while multi-tenant"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"5730\" class=\"elementor elementor-5730\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b76164f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b76164f\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b0a90da\" data-id=\"b0a90da\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\n\t\t<div class=\"elementor-element elementor-element-2ff5382 elementor-widget elementor-widget-text-editor\" data-id=\"2ff5382\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Recently we use Spatie <a href=\"https:\/\/github.com\/spatie\/laravel-multitenancy\">laravel-multitenancy<\/a> package in our of our client&#8217;s CRM project along with <a href=\"https:\/\/github.com\/spatie\/laravel-medialibrary\">spatie\/laravel-medialibrary<\/a>.<\/p><p>The default behavior of the media library package is, it generates a folder for each media with its ID in our configured disk, like a public folder or s3 or whatever disk we configured.<\/p><p>This works really great when you are dealing with a single-tenant application. But while using multi-tenant, you got a media table in each of your tenant databases. so this pattern simply doesn&#8217;t work. Because then you will end up having multiple media files under the same folder from different tenants.<\/p><p>So what we want to do is, instead of having a structure like,<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b81fab4 elementor-widget elementor-widget-code-highlight\" data-id=\"b81fab4\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>public -- media \r\n---- 1 \r\n------ file.jpg \r\n---- 2 \r\n------ file.jpg \r\n...<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4f8abb2 elementor-widget elementor-widget-text-editor\" data-id=\"4f8abb2\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>What we want to achieve is, we want to have a folder structure where media of every tenant will be in a separate folder with tenant unique id,<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-874d90e elementor-widget elementor-widget-code-highlight\" data-id=\"874d90e\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>public -- media \r\n---- abcd1234 \r\n\/\/ tenant1 Id \r\n------ 1 \r\n-------- file.jpg \r\n------ 2 \r\n-------- file.jpg \r\n---- efgh5678 \r\n\/\/ tenant2 Id \r\n------ 1 \r\n-------- file.jpg \r\n------ 2 \r\n-------- file.jpg \r\n...<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9ea9031 elementor-widget elementor-widget-text-editor\" data-id=\"9ea9031\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Spatie Media library is very configurable out of the box where you can write your own media library path generator. That is documented very well over<a href=\"https:\/\/spatie.be\/docs\/laravel-medialibrary\/v8\/advanced-usage\/using-a-custom-directory-structure\"> here<\/a><\/p><p>So what we did is, we wrote our own Path Generator, which can store files into tenants folder. Here is how it looks like,<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7d5ec55 elementor-widget elementor-widget-code-highlight\" data-id=\"7d5ec55\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp><?php\r\nnamespace App\\MediaLibrary;\r\n\r\nuse Spatie\\MediaLibrary\\MediaCollections\\Models\\Media;\r\nuse Spatie\\MediaLibrary\\Support\\PathGenerator\\DefaultPathGenerator;\r\n\r\nclass InfyCRMMediaPathGenerator extends DefaultPathGenerator\r\n{\r\n    \/*\r\n      Get a unique base path for the given media.\r\n     \/\r\n    protected function getBasePath(Media $media): string\r\n    {\r\n        $currentTenant = app('currentTenant');\r\n        return $currentTenant->unique_id.DIRECTORY_SEPARATOR.$media->getKey();\r\n    }\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-292f582 elementor-widget elementor-widget-text-editor\" data-id=\"292f582\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>What we did here is, we just simply extended the <span style=\"color: #e83e8c;\">Spatie\\MediaLibrary\\Support\\PathGenerator\\DefaultPathGenerator<\/span> of Media Library and override the function <span style=\"color: #e83e8c;\">getBasePath<\/span>. We attached the prefix of the tenant&#8217;s <span style=\"color: #e83e8c;\">unique_id<\/span> to the path. so instead of<span style=\"color: #e83e8c;\"> 1\/file.png<\/span>, it will return <span style=\"color: #e83e8c;\">abcd1234\/1\/file.png<\/span>.<\/p><p><strong>All you need to make sure is, whenever you are uploading a media, your application should be tenant aware. Otherwise, it will not able to get the current tenant.<\/strong><\/p><p>Hope this helps while using spatie media library along with spatie multi-tenant.<\/p><p>Even if you are not using a spatie multi-tenant, still you can create your own PathGenerator and use it your own way to have a media structure you want.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Recently we use Spatie laravel-multitenancy package in our of our client&#8217;s CRM project along with&#8230;<\/p>\n","protected":false},"author":2,"featured_media":5734,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"postBodyCss":"","postBodyMargin":[],"postBodyPadding":[],"postBodyBackground":{"backgroundType":"classic","gradient":""},"two_page_speed":[],"footnotes":""},"categories":[9],"tags":[14,114],"class_list":["post-5730","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-tips","tag-troubleshooting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Custom path generation in Spatie Media Library while multi-tenant<\/title>\n<meta name=\"description\" content=\"Set custom path generation in Spatie Media Library for multi-tenant apps, organize files per tenant and streamline media management.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Custom path generation in Spatie Media Library while multi-tenant\" \/>\n<meta property=\"og:description\" content=\"Set custom path generation in Spatie Media Library for multi-tenant apps, organize files per tenant and streamline media management.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog | InfyOm Technologies\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/infyom\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-30T06:59:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-17T08:50:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png\" \/>\n\t<meta property=\"og:image:width\" content=\"772\" \/>\n\t<meta property=\"og:image:height\" content=\"484\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InfyOm\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InfyOm\" \/>\n<meta name=\"twitter:site\" content=\"@InfyOm\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InfyOm\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/\"},\"author\":{\"name\":\"InfyOm\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754\"},\"headline\":\"Custom path generation in Spatie Media Library while multi-tenant\",\"datePublished\":\"2020-07-30T06:59:17+00:00\",\"dateModified\":\"2025-07-17T08:50:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/\"},\"wordCount\":317,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/infyom.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png\",\"keywords\":[\"Tips\",\"Troubleshooting\"],\"articleSection\":[\"Laravel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/\",\"url\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/\",\"name\":\"Custom path generation in Spatie Media Library while multi-tenant\",\"isPartOf\":{\"@id\":\"https:\/\/infyom.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png\",\"datePublished\":\"2020-07-30T06:59:17+00:00\",\"dateModified\":\"2025-07-17T08:50:48+00:00\",\"description\":\"Set custom path generation in Spatie Media Library for multi-tenant apps, organize files per tenant and streamline media management.\",\"breadcrumb\":{\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#primaryimage\",\"url\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png\",\"contentUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png\",\"width\":772,\"height\":484,\"caption\":\"Custom path generation in Spatie Media Library while multi-tenant\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/infyom.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Custom path generation in Spatie Media Library while multi-tenant\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/infyom.com\/blog\/#website\",\"url\":\"https:\/\/infyom.com\/blog\/\",\"name\":\"Blog | InfyOm Technologies\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/infyom.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/infyom.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/infyom.com\/blog\/#organization\",\"name\":\"InfyOm Technologies\",\"url\":\"https:\/\/infyom.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png\",\"contentUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png\",\"width\":88,\"height\":41,\"caption\":\"InfyOm Technologies\"},\"image\":{\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/infyom\",\"https:\/\/x.com\/InfyOm\",\"https:\/\/www.instagram.com\/infyomtechnologies\/\",\"https:\/\/in.linkedin.com\/company\/infyom-technologies\",\"https:\/\/github.com\/infyomlabs\",\"https:\/\/x.com\/infyom\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754\",\"name\":\"InfyOm\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g\",\"caption\":\"InfyOm\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Custom path generation in Spatie Media Library while multi-tenant","description":"Set custom path generation in Spatie Media Library for multi-tenant apps, organize files per tenant and streamline media management.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/","og_locale":"en_US","og_type":"article","og_title":"Custom path generation in Spatie Media Library while multi-tenant","og_description":"Set custom path generation in Spatie Media Library for multi-tenant apps, organize files per tenant and streamline media management.","og_url":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/","og_site_name":"Blog | InfyOm Technologies","article_publisher":"https:\/\/www.facebook.com\/infyom","article_published_time":"2020-07-30T06:59:17+00:00","article_modified_time":"2025-07-17T08:50:48+00:00","og_image":[{"width":772,"height":484,"url":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png","type":"image\/png"}],"author":"InfyOm","twitter_card":"summary_large_image","twitter_creator":"@InfyOm","twitter_site":"@InfyOm","twitter_misc":{"Written by":"InfyOm","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#article","isPartOf":{"@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/"},"author":{"name":"InfyOm","@id":"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754"},"headline":"Custom path generation in Spatie Media Library while multi-tenant","datePublished":"2020-07-30T06:59:17+00:00","dateModified":"2025-07-17T08:50:48+00:00","mainEntityOfPage":{"@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/"},"wordCount":317,"commentCount":0,"publisher":{"@id":"https:\/\/infyom.com\/blog\/#organization"},"image":{"@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#primaryimage"},"thumbnailUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png","keywords":["Tips","Troubleshooting"],"articleSection":["Laravel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/","url":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/","name":"Custom path generation in Spatie Media Library while multi-tenant","isPartOf":{"@id":"https:\/\/infyom.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#primaryimage"},"image":{"@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#primaryimage"},"thumbnailUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png","datePublished":"2020-07-30T06:59:17+00:00","dateModified":"2025-07-17T08:50:48+00:00","description":"Set custom path generation in Spatie Media Library for multi-tenant apps, organize files per tenant and streamline media management.","breadcrumb":{"@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#primaryimage","url":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png","contentUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/custom-path-generator.png","width":772,"height":484,"caption":"Custom path generation in Spatie Media Library while multi-tenant"},{"@type":"BreadcrumbList","@id":"https:\/\/infyom.com\/blog\/custom-path-generation-in-spatie-media-library-while-multi-tenant\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/infyom.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Custom path generation in Spatie Media Library while multi-tenant"}]},{"@type":"WebSite","@id":"https:\/\/infyom.com\/blog\/#website","url":"https:\/\/infyom.com\/blog\/","name":"Blog | InfyOm Technologies","description":"","publisher":{"@id":"https:\/\/infyom.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/infyom.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/infyom.com\/blog\/#organization","name":"InfyOm Technologies","url":"https:\/\/infyom.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png","contentUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png","width":88,"height":41,"caption":"InfyOm Technologies"},"image":{"@id":"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/infyom","https:\/\/x.com\/InfyOm","https:\/\/www.instagram.com\/infyomtechnologies\/","https:\/\/in.linkedin.com\/company\/infyom-technologies","https:\/\/github.com\/infyomlabs","https:\/\/x.com\/infyom"]},{"@type":"Person","@id":"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754","name":"InfyOm","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/infyom.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g","caption":"InfyOm"}}]}},"_links":{"self":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts\/5730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/comments?post=5730"}],"version-history":[{"count":21,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts\/5730\/revisions"}],"predecessor-version":[{"id":8168,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts\/5730\/revisions\/8168"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/media\/5734"}],"wp:attachment":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/media?parent=5730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/categories?post=5730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/tags?post=5730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}