[{"data":1,"prerenderedAt":627},["ShallowReactive",2],{"navigation_docs":3,"-essentials-media-library":78,"-essentials-media-library-surround":622},[4,26,62],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":25},"Getting Started","i-lucide-rocket","/getting-started","1.getting-started",[10,15,20],{"title":11,"path":12,"stem":13,"icon":14},"Installation","/getting-started/installation","1.getting-started/1.installation","i-lucide-download",{"title":16,"path":17,"stem":18,"icon":19},"Frontend Setup (headless)","/getting-started/frontend-setup","1.getting-started/2.frontend-setup","i-lucide-layout",{"title":21,"path":22,"stem":23,"icon":24},"Public-routes mode","/getting-started/public-routes-mode","1.getting-started/3.public-routes-mode","i-lucide-zap",false,{"title":27,"icon":28,"path":29,"stem":30,"children":31,"page":25},"Essentials","i-lucide-book-open","/essentials","2.essentials",[32,37,42,47,52,57],{"title":33,"path":34,"stem":35,"icon":36},"Blade Components","/essentials/blade-components","2.essentials/1.blade-components","i-lucide-component",{"title":38,"path":39,"stem":40,"icon":41},"Filament Admin","/essentials/filament-admin","2.essentials/2.filament-admin","i-lucide-layout-dashboard",{"title":43,"path":44,"stem":45,"icon":46},"MCP Tools","/essentials/mcp-tools","2.essentials/3.mcp-tools","i-lucide-bot",{"title":48,"path":49,"stem":50,"icon":51},"Configuration","/essentials/configuration","2.essentials/4.configuration","i-lucide-settings",{"title":53,"path":54,"stem":55,"icon":56},"Tags Taxonomy","/essentials/tags","2.essentials/5.tags","i-lucide-hash",{"title":58,"path":59,"stem":60,"icon":61},"MediaLibrary Integration","/essentials/media-library","2.essentials/6.media-library","i-lucide-image",{"title":63,"icon":64,"path":65,"stem":66,"children":67,"page":25},"Community","i-lucide-users","/community","4.community",[68,73],{"title":69,"path":70,"stem":71,"icon":72},"Contributing","/community/contributing","4.community/1.contributing","i-lucide-git-pull-request",{"title":74,"path":75,"stem":76,"icon":77},"License","/community/license","4.community/2.license","i-lucide-scale",{"id":79,"title":58,"body":80,"description":615,"extension":616,"links":617,"meta":618,"navigation":619,"path":59,"seo":620,"stem":60,"__hash__":621},"docs/2.essentials/6.media-library.md",{"type":81,"value":82,"toc":609},"minimark",[83,111,126,131,266,270,288,295,536,539,555,568,575,581,602,605],[84,85,86,87,91,92,102,103,106,107,110],"p",{},"The package ships an ",[88,89,90],"strong",{},"opt-in"," integration with ",[93,94,98],"a",{"href":95,"rel":96},"https://spatie.be/docs/laravel-medialibrary",[97],"nofollow",[99,100,101],"code",{},"spatie/laravel-medialibrary",". When enabled, the featured-image upload uses ",[99,104,105],{},"SpatieMediaLibraryFileUpload"," instead of the default ",[99,108,109],{},"FileUpload",".",[112,113,115,118,119,121,122,125],"alert",{"type":114},"info",[88,116,117],{},"MediaLibrary is not a hard dependency."," If you don't install it, the form gracefully falls back to the plain ",[99,120,109],{}," — no crash. Flipping ",[99,123,124],{},"features.media_library"," without installing MediaLibrary is a no-op.",[127,128,130],"h2",{"id":129},"enable","Enable",[132,133,134,209,255],"ol",{},[135,136,137,138],"li",{},"Install the package:",[139,140,146],"pre",{"className":141,"code":142,"filename":143,"language":144,"meta":145,"style":145},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","composer require spatie/laravel-medialibrary\nphp artisan vendor:publish --provider=\"Spatie\\MediaLibrary\\MediaLibraryServiceProvider\" --tag=\"medialibrary-migrations\"\nphp artisan migrate\n","Terminal","bash","",[99,147,148,164,199],{"__ignoreMap":145},[149,150,153,157,161],"span",{"class":151,"line":152},"line",1,[149,154,156],{"class":155},"sBMFI","composer",[149,158,160],{"class":159},"sfazB"," require",[149,162,163],{"class":159}," spatie/laravel-medialibrary\n",[149,165,167,170,173,176,179,183,186,188,191,193,196],{"class":151,"line":166},2,[149,168,169],{"class":155},"php",[149,171,172],{"class":159}," artisan",[149,174,175],{"class":159}," vendor:publish",[149,177,178],{"class":159}," --provider=",[149,180,182],{"class":181},"sMK4o","\"",[149,184,185],{"class":159},"Spatie\\MediaLibrary\\MediaLibraryServiceProvider",[149,187,182],{"class":181},[149,189,190],{"class":159}," --tag=",[149,192,182],{"class":181},[149,194,195],{"class":159},"medialibrary-migrations",[149,197,198],{"class":181},"\"\n",[149,200,202,204,206],{"class":151,"line":201},3,[149,203,169],{"class":155},[149,205,172],{"class":159},[149,207,208],{"class":159}," migrate\n",[135,210,211,212],{},"Flip the flag:",[139,213,217],{"className":214,"code":215,"filename":216,"language":169,"meta":145,"style":145},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","'features' => [\n    'media_library' => true,\n],\n","config/filament-blog.php",[99,218,219,235,250],{"__ignoreMap":145},[149,220,221,224,227,229,232],{"class":151,"line":152},[149,222,223],{"class":181},"'",[149,225,226],{"class":159},"features",[149,228,223],{"class":181},[149,230,231],{"class":181}," =>",[149,233,234],{"class":181}," [\n",[149,236,237,240,243,245,247],{"class":151,"line":166},[149,238,239],{"class":181},"    '",[149,241,242],{"class":159},"media_library",[149,244,223],{"class":181},[149,246,231],{"class":181},[149,248,249],{"class":181}," true,\n",[149,251,252],{"class":151,"line":201},[149,253,254],{"class":181},"],\n",[135,256,257,258,261,262,265],{},"Use the form as usual — the featured-image field now writes to the MediaLibrary ",[99,259,260],{},"media"," table on a ",[99,263,264],{},"featured_image"," collection.",[127,267,269],{"id":268},"form-side-only-for-now","Form-side only (for now)",[84,271,272,273,276,277,280,281,284,285,287],{},"This integration covers the ",[88,274,275],{},"admin form-component swap only",". The model-side integration (implementing ",[99,278,279],{},"HasMedia",", registering collections via ",[99,282,283],{},"registerMediaCollections()",", migrating existing ",[99,286,264],{}," string column data) is intentionally deferred — that requires careful schema-migration design that doesn't fit a feature-flag layer.",[84,289,290,291,294],{},"If you want the full integration today, override the ",[99,292,293],{},"Post"," model in your app:",[139,296,299],{"className":214,"code":297,"filename":298,"language":169,"meta":145,"style":145},"namespace App\\Models;\n\nuse ManukMinasyan\\FilamentBlog\\Models\\Post as BasePost;\nuse Spatie\\MediaLibrary\\HasMedia;\nuse Spatie\\MediaLibrary\\InteractsWithMedia;\nuse Spatie\\MediaLibrary\\MediaCollections\\Models\\Collections\\MediaCollection;\n\nclass BlogPost extends BasePost implements HasMedia\n{\n    use InteractsWithMedia;\n\n    public function registerMediaCollections(): void\n    {\n        $this->addMediaCollection('featured_image')->singleFile();\n    }\n}\n","app/Models/BlogPost.php",[99,300,301,319,325,355,374,392,424,429,450,456,467,472,491,497,524,530],{"__ignoreMap":145},[149,302,303,307,310,313,316],{"class":151,"line":152},[149,304,306],{"class":305},"sbssI","namespace",[149,308,309],{"class":155}," App",[149,311,312],{"class":181},"\\",[149,314,315],{"class":155},"Models",[149,317,318],{"class":181},";\n",[149,320,321],{"class":151,"line":166},[149,322,324],{"emptyLinePlaceholder":323},true,"\n",[149,326,327,330,334,336,339,341,343,345,347,350,353],{"class":151,"line":201},[149,328,329],{"class":305},"use",[149,331,333],{"class":332},"sTEyZ"," ManukMinasyan",[149,335,312],{"class":181},[149,337,338],{"class":332},"FilamentBlog",[149,340,312],{"class":181},[149,342,315],{"class":332},[149,344,312],{"class":181},[149,346,293],{"class":332},[149,348,349],{"class":305}," as",[149,351,352],{"class":155}," BasePost",[149,354,318],{"class":181},[149,356,358,360,363,365,368,370,372],{"class":151,"line":357},4,[149,359,329],{"class":305},[149,361,362],{"class":332}," Spatie",[149,364,312],{"class":181},[149,366,367],{"class":332},"MediaLibrary",[149,369,312],{"class":181},[149,371,279],{"class":332},[149,373,318],{"class":181},[149,375,377,379,381,383,385,387,390],{"class":151,"line":376},5,[149,378,329],{"class":305},[149,380,362],{"class":332},[149,382,312],{"class":181},[149,384,367],{"class":332},[149,386,312],{"class":181},[149,388,389],{"class":332},"InteractsWithMedia",[149,391,318],{"class":181},[149,393,395,397,399,401,403,405,408,410,412,414,417,419,422],{"class":151,"line":394},6,[149,396,329],{"class":305},[149,398,362],{"class":332},[149,400,312],{"class":181},[149,402,367],{"class":332},[149,404,312],{"class":181},[149,406,407],{"class":332},"MediaCollections",[149,409,312],{"class":181},[149,411,315],{"class":332},[149,413,312],{"class":181},[149,415,416],{"class":332},"Collections",[149,418,312],{"class":181},[149,420,421],{"class":332},"MediaCollection",[149,423,318],{"class":181},[149,425,427],{"class":151,"line":426},7,[149,428,324],{"emptyLinePlaceholder":323},[149,430,432,436,439,442,444,447],{"class":151,"line":431},8,[149,433,435],{"class":434},"spNyl","class",[149,437,438],{"class":155}," BlogPost",[149,440,441],{"class":434}," extends",[149,443,352],{"class":155},[149,445,446],{"class":434}," implements",[149,448,449],{"class":155}," HasMedia\n",[149,451,453],{"class":151,"line":452},9,[149,454,455],{"class":181},"{\n",[149,457,459,462,465],{"class":151,"line":458},10,[149,460,461],{"class":305},"    use",[149,463,464],{"class":332}," InteractsWithMedia",[149,466,318],{"class":181},[149,468,470],{"class":151,"line":469},11,[149,471,324],{"emptyLinePlaceholder":323},[149,473,475,478,481,485,488],{"class":151,"line":474},12,[149,476,477],{"class":434},"    public",[149,479,480],{"class":434}," function",[149,482,484],{"class":483},"s2Zo4"," registerMediaCollections",[149,486,487],{"class":181},"():",[149,489,490],{"class":305}," void\n",[149,492,494],{"class":151,"line":493},13,[149,495,496],{"class":181},"    {\n",[149,498,500,503,506,509,511,513,515,518,521],{"class":151,"line":499},14,[149,501,502],{"class":181},"        $this->",[149,504,505],{"class":483},"addMediaCollection",[149,507,508],{"class":181},"(",[149,510,223],{"class":181},[149,512,264],{"class":159},[149,514,223],{"class":181},[149,516,517],{"class":181},")->",[149,519,520],{"class":483},"singleFile",[149,522,523],{"class":181},"();\n",[149,525,527],{"class":151,"line":526},15,[149,528,529],{"class":181},"    }\n",[149,531,533],{"class":151,"line":532},16,[149,534,535],{"class":181},"}\n",[84,537,538],{},"Then point the package at your model:",[139,540,542],{"className":214,"code":541,"filename":216,"language":169,"meta":145,"style":145},"// (post_model is not currently a config key — track this in\n// Phase 3 follow-up; for now the package always uses its own Post)\n",[99,543,544,550],{"__ignoreMap":145},[149,545,546],{"class":151,"line":152},[149,547,549],{"class":548},"sHwdD","// (post_model is not currently a config key — track this in\n",[149,551,552],{"class":151,"line":166},[149,553,554],{"class":548},"// Phase 3 follow-up; for now the package always uses its own Post)\n",[112,556,558,559,564,565,110],{"type":557},"warning","Swapping the post model isn't a config option in v1.4 — that lands in Phase 3 along with the model-side integration. Watch the ",[93,560,563],{"href":561,"rel":562},"https://github.com/ManukMinasyan/filament-blog/releases",[97],"GitHub releases"," for ",[99,566,567],{},"v1.5",[127,569,571,572,574],{"id":570},"migrating-existing-featured_image-data","Migrating existing ",[99,573,264],{}," data",[84,576,577,578,580],{},"When Phase 3 lands, existing posts with a ",[99,579,264],{}," string path will be migrated to MediaLibrary entries via a console command. Until then, two options:",[132,582,583,591],{},[135,584,585,590],{},[88,586,587,588],{},"Stay on ",[99,589,109],{}," — leave the flag off. No migration required.",[135,592,593,596,597,599,600,265],{},[88,594,595],{},"Manual migration"," — write your own script to copy ",[99,598,264],{}," files into MediaLibrary on a ",[99,601,264],{},[84,603,604],{},"Both Tapix and FilaForms blogs (which this package replaces) use the same string-column approach, so flipping the flag without migration leaves you in a usable state — new posts go to MediaLibrary, old posts keep using the string path. The shipped views render whichever exists.",[606,607,608],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":145,"searchDepth":166,"depth":166,"links":610},[611,612,613],{"id":129,"depth":166,"text":130},{"id":268,"depth":166,"text":269},{"id":570,"depth":166,"text":614},"Migrating existing featured_image data","Opt-in featured-image upload via spatie/laravel-medialibrary.","md",null,{},{"icon":61},{"title":58,"description":615},"yhUohN7XCJHVmN9PlzN9jnZWfR9Aj6NljCHXcRVgTqw",[623,625],{"title":53,"path":54,"stem":55,"description":624,"icon":56,"children":-1},"Opt-in many-to-many tags taxonomy with admin UI and public archive.",{"title":69,"path":70,"stem":71,"description":626,"icon":72,"children":-1},"How to contribute to Filament Blog.",1778325338217]