{"id":34689519,"url":"https://github.com/mooxphp/media","last_synced_at":"2026-04-24T10:32:45.460Z","repository":{"id":275861597,"uuid":"922975579","full_name":"mooxphp/media","owner":"mooxphp","description":"[READ-ONLY] Media Library for Laravel and Filament","archived":false,"fork":false,"pushed_at":"2026-02-20T14:55:35.000Z","size":311,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-20T18:59:09.368Z","etag":null,"topics":["filament","laravel","library","media","moox","spatie"],"latest_commit_sha":null,"homepage":"https://moox.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mooxphp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["mooxphp"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2025-01-27T12:34:43.000Z","updated_at":"2026-02-20T14:55:37.000Z","dependencies_parsed_at":"2025-02-05T00:29:26.751Z","dependency_job_id":"c207edbb-f1bd-40cd-bf32-5cb64120381d","html_url":"https://github.com/mooxphp/media","commit_stats":null,"previous_names":["mooxphp/media"],"tags_count":17,"template":false,"template_full_name":"mooxphp/skeleton","purl":"pkg:github/mooxphp/media","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooxphp%2Fmedia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooxphp%2Fmedia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooxphp%2Fmedia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooxphp%2Fmedia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mooxphp","download_url":"https://codeload.github.com/mooxphp/media/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooxphp%2Fmedia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32219000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filament","laravel","library","media","moox","spatie"],"created_at":"2025-12-24T21:57:23.388Z","updated_at":"2026-04-24T10:32:45.456Z","avatar_url":"https://github.com/mooxphp.png","language":"PHP","funding_links":["https://github.com/sponsors/mooxphp"],"categories":[],"sub_categories":[],"readme":"# Moox Media Package\n\nA comprehensive media management package for FilamentPHP with translation support.\n\n## Installation\n\nInstall the package using the Moox installer:\n\n```bash\nphp artisan moox:install\n```\n\nThis will:\n- Publish migrations and configuration files\n- Publish Spatie Media Library configuration\n- Integrate the custom Media model and PathGenerator\n\n## Features\n\n- **Media Management**: Upload, organize, and manage media files with Spatie Media Library integration\n- **Translations**: Full translation support for media metadata\n- **MediaPicker Component**: Filament form component for selecting and attaching media to models\n- **Media Collections**: Organize media into collections with translation support\n\n## Usage\n\n### Setup Model for Media\n\nTo use media in your model, you need to:\n\n1. Use the `HasMediaUsable` trait\n2. Implement `HasMedia` interface\n3. Use `InteractsWithMedia` trait from Spatie Media Library\n4. Add a JSON field for storing media metadata (e.g., `image`)\n5. Optionally add a relation method to access media through usables\n\nExample:\n\n```php\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Moox\\Media\\Traits\\HasMediaUsable;\nuse Spatie\\Image\\Enums\\Fit;\nuse Spatie\\MediaLibrary\\HasMedia;\nuse Spatie\\MediaLibrary\\InteractsWithMedia;\nuse Spatie\\MediaLibrary\\MediaCollections\\Models\\Media;\n\nclass Draft extends Model implements HasMedia\n{\n    use HasMediaUsable, InteractsWithMedia;\n\n    protected $fillable = [\n        'image', // JSON field for media metadata\n        // ... other fields\n    ];\n\n    protected $casts = [\n        'image' =\u003e 'json',\n        // ... other casts\n    ];\n\n    // Optional: Access media through usables relation\n    public function mediaThroughUsables()\n    {\n        return $this-\u003ebelongsToMany(\n            Media::class,\n            'media_usables',\n            'media_usable_id',\n            'media_id'\n        )-\u003ewhere('media_usables.media_usable_type', '=', static::class);\n    }\n\n    // Optional: Register media conversions\n    public function registerMediaConversions(?Media $media = null): void\n    {\n        $this-\u003eaddMediaConversion('preview')\n            -\u003efit(Fit::Contain, 300, 300);\n    }\n}\n```\n\n### Use MediaPicker in Filament Forms\n\n```php\nuse Moox\\Media\\Forms\\Components\\MediaPicker;\n\nMediaPicker::make('image')\n    -\u003emultiple(false)\n    -\u003eacceptedFileTypes(['image/jpeg', 'image/png'])\n```\n\n### Access Media Metadata\n\nWhen media is attached via MediaPicker, the JSON field contains:\n\n```json\n{\n    \"file_name\": \"example.jpg\",\n    \"title\": \"Example Image\",\n    \"alt\": \"Example Image\",\n    \"description\": \"Image description\",\n    \"internal_note\": \"Internal notes\"\n}\n```\n\n### Editing Media Metadata\n\nWhen editing media in the admin panel, fields like `title`, `alt`, `description`, and `internal_note` are automatically saved as soon as you leave the field (blur event). No save button is required - changes are persisted immediately and synchronized to all models using that media.\n\n## Requirements\n\n- Laravel 12+\n- Filament 4+\n- Spatie Media Library\n- Astrotomic Translatable\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooxphp%2Fmedia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmooxphp%2Fmedia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooxphp%2Fmedia/lists"}