[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77NB02GN6C9Q8TJ8THJKAXR":3,"skill-same:01M77NB02GN6C9Q8TJ8THJKAXR":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M77NB02GN6C9Q8TJ8THJKAXR","medialibrary-development",null,"Build and work with spatie\u002Flaravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving media URLs and paths.","w1do\u002Fcontent-backend","w1do","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F122446147?v=4","01M77N9PAY1Z1RMN8S3936Q9Y9","W1DO DIGITAL","01M77N9PBRQG10QM0Z8WFRAK25",1,"MIT","https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fskills\u002Fmedialibrary-development\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: medialibrary-development\ndescription: Build and work with spatie\u002Flaravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving media URLs and paths.\nlicense: MIT\nmetadata:\n  author: Spatie\n---\n\n# Media Library Development\n\n## Overview\nUse spatie\u002Flaravel-medialibrary to associate files with Eloquent models. Supports image\u002Fvideo conversions, responsive images, multiple collections, and various storage disks.\n\n## When to Activate\n- Activate when working with file uploads, media attachments, or image processing in Laravel.\n- Activate when code references `HasMedia`, `InteractsWithMedia`, the `Media` model, or media collections\u002Fconversions.\n- Activate when the user wants to add, retrieve, convert, or manage files attached to Eloquent models.\n\n## Scope\n- In scope: media uploads, collections, conversions, responsive images, custom properties, file retrieval, path\u002FURL generation.\n- Out of scope: general file storage without Eloquent association, non-Laravel frameworks.\n\n## Workflow\n1. Identify the task (model setup, adding media, defining conversions, retrieving files, etc.).\n2. Read `references\u002Fmedialibrary-guide.md` and focus on the relevant section.\n3. Apply the patterns from the reference, keeping code minimal and Laravel-native.\n\n## Core Concepts\n\n### Model Setup\nEvery model that should have media must implement `HasMedia` and use the `InteractsWithMedia` trait:\n\n```php\nuse Spatie\\MediaLibrary\\HasMedia;\nuse Spatie\\MediaLibrary\\InteractsWithMedia;\n\nclass BlogPost extends Model implements HasMedia\n{\n    use InteractsWithMedia;\n}\n```\n\n### Adding Media\n```php\n$blogPost->addMedia($file)->toMediaCollection('images');\n$blogPost->addMediaFromUrl($url)->toMediaCollection('images');\n$blogPost->addMediaFromRequest('file')->toMediaCollection('images');\n```\n\n### Defining Collections\n```php\npublic function registerMediaCollections(): void\n{\n    $this->addMediaCollection('avatar')->singleFile();\n    $this->addMediaCollection('downloads')->useDisk('s3');\n}\n```\n\n### Defining Conversions\n```php\nuse Spatie\\MediaLibrary\\MediaCollections\\Models\\Media;\nuse Spatie\\Image\\Enums\\Fit;\n\npublic function registerMediaConversions(?Media $media = null): void\n{\n    $this->addMediaConversion('thumb')\n        ->fit(Fit::Contain, 300, 300)\n        ->nonQueued();\n}\n```\n\n### Retrieving Media\n```php\n$url = $model->getFirstMediaUrl('images');\n$thumbUrl = $model->getFirstMediaUrl('images', 'thumb');\n$allMedia = $model->getMedia('images');\n```\n\n## Do and Don't\n\nDo:\n- Always implement the `HasMedia` interface alongside the `InteractsWithMedia` trait.\n- Use `?Media $media = null` as the parameter for `registerMediaConversions()`.\n- Call `->toMediaCollection()` to finalize adding media.\n- Use `->nonQueued()` for conversions that should run synchronously.\n- Use `->singleFile()` on collections that should only hold one file.\n- Use `Spatie\\Image\\Enums\\Fit` enum values for fit methods.\n\nDon't:\n- Don't forget to run `php artisan vendor:publish --provider=\"Spatie\\MediaLibrary\\MediaLibraryServiceProvider\" --tag=\"medialibrary-migrations\"` before migrating.\n- Don't use `env()` for disk configuration; use `config()` or set it in `config\u002Fmedia-library.php`.\n- Don't call `addMedia()` without calling `toMediaCollection()` — the media won't be saved.\n- Don't reference conversion names that aren't registered in `registerMediaConversions()`.\n\n## References\n- `references\u002Fmedialibrary-guide.md`\n","# Media Library Development\n\n## Overview\nUse spatie\u002Flaravel-medialibrary to associate files with Eloquent models. Supports image\u002Fvideo conversions, responsive images, multiple collections, and various storage disks.\n\n## When to Activate\n- Activate when working with file uploads, media attachments, or image processing in Laravel.\n- Activate when code references `HasMedia`, `InteractsWithMedia`, the `Media` model, or media collections\u002Fconversions.\n- Activate when the user wants to add, retrieve, convert, or manage files attached to Eloquent models.\n\n## Scope\n- In scope: media uploads, collections, conversions, responsive images, custom properties, file retrieval, path\u002FURL generation.\n- Out of scope: general file storage without Eloquent association, non-Laravel frameworks.\n\n## Workflow\n1. Identify the task (model setup, adding media, defining conversions, retrieving files, etc.).\n2. Read `references\u002Fmedialibrary-guide.md` and focus on the relevant section.\n3. Apply the patterns from the reference, keeping code minimal and Laravel-native.\n\n## Core Concepts\n\n### Model Setup\nEvery model that should have media must implement `HasMedia` and use the `InteractsWithMedia` trait:\n\n```php\nuse Spatie\\MediaLibrary\\HasMedia;\nuse Spatie\\MediaLibrary\\InteractsWithMedia;\n\nclass BlogPost extends Model implements HasMedia\n{\n    use InteractsWithMedia;\n}\n```\n\n### Adding Media\n```php\n$blogPost->addMedia($file)->toMediaCollection('images');\n$blogPost->addMediaFromUrl($url)->toMediaCollection('images');\n$blogPost->addMediaFromRequest('file')->toMediaCollection('images');\n```\n\n### Defining Collections\n```php\npublic function registerMediaCollections(): void\n{\n    $this->addMediaCollection('avatar')->singleFile();\n    $this->addMediaCollection('downloads')->useDisk('s3');\n}\n```\n\n### Defining Conversions\n```php\nuse Spatie\\MediaLibrary\\MediaCollections\\Models\\Media;\nuse Spatie\\Image\\Enums\\Fit;\n\npublic function registerMediaConversions(?Media $media = null): void\n{\n    $this->addMediaConversion('thumb')\n        ->fit(Fit::Contain, 300, 300)\n        ->nonQueued();\n}\n```\n\n### Retrieving Media\n```php\n$url = $model->getFirstMediaUrl('images');\n$thumbUrl = $model->getFirstMediaUrl('images', 'thumb');\n$allMedia = $model->getMedia('images');\n```\n\n## Do and Don't\n\nDo:\n- Always implement the `HasMedia` interface alongside the `InteractsWithMedia` trait.\n- Use `?Media $media = null` as the parameter for `registerMediaConversions()`.\n- Call `->toMediaCollection()` to finalize adding media.\n- Use `->nonQueued()` for conversions that should run synchronously.\n- Use `->singleFile()` on collections that should only hold one file.\n- Use `Spatie\\Image\\Enums\\Fit` enum values for fit methods.\n\nDon't:\n- Don't forget to run `php artisan vendor:publish --provider=\"Spatie\\MediaLibrary\\MediaLibraryServiceProvider\" --tag=\"medialibrary-migrations\"` before migrating.\n- Don't use `env()` for disk configuration; use `config()` or set it in `config\u002Fmedia-library.php`.\n- Don't call `addMedia()` without calling `toMediaCollection()` — the media won't be saved.\n- Don't reference conversion names that aren't registered in `registerMediaConversions()`.\n\n## References\n- `references\u002Fmedialibrary-guide.md`\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25},"Spatie","main","5cfcb5a7c17ede079f700eaebe2541a2e8a35b99",".ai\u002Fskills\u002Fskills\u002Fmedialibrary-development",0,"https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend","https:\u002F\u002Fgithub.com\u002Fw1do","https:\u002F\u002Fw1do.ru","Разработчик с использованием AI (Claude, Junie), автоматизация систем, построение сложной архитектуры на Laravel","2026-07-30 04:57:34",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add w1do\u002Fcontent-backend --skill medialibrary-development",{"tool":41,"command":42},"bunx","bunx skills add w1do\u002Fcontent-backend --skill medialibrary-development",{"tool":44,"command":45},"pnpm","pnpm dlx skills add w1do\u002Fcontent-backend --skill medialibrary-development","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fskills\u002Fmedialibrary-development\u002FSKILL.md",true,[49],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fmedialibrary-guide.md","REFERENCE","参考文档",14619,"https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fskills\u002Fmedialibrary-development\u002Freferences\u002Fmedialibrary-guide.md",[56,63,70,77,84,91],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M77NER3ZH88RF7652A2GPV0N","spatie-version-control","Apply Spatie's version control conventions when creating commits, branches, pull requests, or managing Git repositories; use for naming repos, writing commit messages, choosing branch strategies, and merging code.","https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.junie\u002Fskills\u002Fspatie-version-control\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M77NEM7BB0878PKWFZFBFV2A","spatie-security","Apply Spatie's security guidelines when configuring applications, databases, or servers, or when reviewing code for security concerns; use for SSL setup, CSRF protection, password hashing, database permissions, and server hardening.","https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.junie\u002Fskills\u002Fspatie-security\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M77NEH0V5W6RZP9VJXRBR9QT","spatie-laravel-php","Apply Spatie's Laravel and PHP coding standards for any task that creates, edits, reviews, refactors, or formats Laravel\u002FPHP code or Blade templates; use for controllers, Eloquent models, routes, config, validation, migrations, tests, and related files to align with Laravel conventions and PSR-12.","https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.junie\u002Fskills\u002Fspatie-laravel-php\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M77NECV2J2GTVQ7KDM5X2WC4","spatie-javascript","Apply Spatie's JavaScript coding standards for any task that creates, edits, reviews, refactors, or formats JavaScript or TypeScript code; use for variable declarations, comparisons, functions, destructuring, and Prettier configuration to align with Spatie's JS conventions.","https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.junie\u002Fskills\u002Fspatie-javascript\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M77NE4V810CG6DRAKNFEREZ4","sluggable-development","Use when making a field on an Eloquent model sluggable, generating the migration for a slug column, switching to self-healing URLs, or resolving a model from its slug in a route. Trigger when the request mentions slugs, permalinks, the spatie\u002Flaravel-sluggable package, the HasSlug or HasTranslatableSlug trait, the #[Sluggable] attribute, SlugOptions, findBySlug, self-healing URLs, or stale slug redirects in a Laravel project. Covers choosing between the attribute and the trait, generating unique slugs, configuring separator\u002Flength\u002Flanguage\u002Fscope\u002Funiqueness, preventing slug overwrites, translatable slugs via spatie\u002Flaravel-translatable, route model binding through the slug column, self-healing route keys, customizing the 308 redirect through the SelfHealing facade, and overriding the default actions via config\u002Fsluggable.php. Do not use for one-off URL-safe strings, signed URLs, or Laravel's built-in Str::slug helper when the result is not stored on a model.","https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.junie\u002Fskills\u002Fsluggable-development\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M77NDSVMR88QCTD52WBBM72V","olakunlevpn-filament-skills","Use when writing, reviewing, or refactoring Filament PHP v5 code -- resources, forms, tables, infolists, actions, widgets, panels, relation managers, multi-tenancy, testing, or plugin development. Always apply these standards to all Filament work.","https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.junie\u002Fskills\u002Folakunlevpn-filament-skills\u002FLICENSE.md","https:\u002F\u002Fgithub.com\u002Fw1do\u002Fcontent-backend\u002Fblob\u002Fmain\u002F.junie\u002Fskills\u002Folakunlevpn-filament-skills\u002FSKILL.md",[],[]]