{"id":13608622,"url":"https://github.com/plank/laravel-mediable","last_synced_at":"2025-05-13T21:11:48.668Z","repository":{"id":37251769,"uuid":"63791110","full_name":"plank/laravel-mediable","owner":"plank","description":"Laravel-Mediable is a package for easily uploading and attaching media files to models with Laravel","archived":false,"fork":false,"pushed_at":"2025-03-06T02:21:28.000Z","size":2239,"stargazers_count":803,"open_issues_count":6,"forks_count":108,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-28T17:09:57.612Z","etag":null,"topics":["eloquent","file-upload","hacktoberfest","laravel"],"latest_commit_sha":null,"homepage":"","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/plank.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-20T15:07:43.000Z","updated_at":"2025-04-21T13:28:36.000Z","dependencies_parsed_at":"2024-01-17T00:18:17.134Z","dependency_job_id":"7207eead-7f11-4e93-bb6e-897a17dd3535","html_url":"https://github.com/plank/laravel-mediable","commit_stats":{"total_commits":392,"total_committers":31,"mean_commits":12.64516129032258,"dds":0.5127551020408163,"last_synced_commit":"4795faf57e0057e0c7634e20dc29ecfaf11aa49f"},"previous_names":[],"tags_count":89,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plank%2Flaravel-mediable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plank%2Flaravel-mediable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plank%2Flaravel-mediable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plank%2Flaravel-mediable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plank","download_url":"https://codeload.github.com/plank/laravel-mediable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254029004,"owners_count":22002283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["eloquent","file-upload","hacktoberfest","laravel"],"created_at":"2024-08-01T19:01:28.694Z","updated_at":"2025-05-13T21:11:43.652Z","avatar_url":"https://github.com/plank.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Laravel-Mediable\n\n[![Coveralls](https://img.shields.io/coveralls/plank/laravel-mediable.svg?style=flat-square)](https://coveralls.io/github/plank/laravel-mediable)\n[![StyleCI](https://styleci.io/repos/63791110/shield)](https://styleci.io/repos/63791110)\n[![Packagist](https://img.shields.io/packagist/v/plank/laravel-mediable.svg?style=flat-square)](https://packagist.org/packages/plank/laravel-mediable)\n\nLaravel-Mediable is a package for easily uploading and attaching media files to models with Laravel.\n\n## Features\n\n- Filesystem-driven approach is easily configurable to allow any number of upload directories with different accessibility. Easily restrict uploads by MIME type, extension and/or aggregate type (e.g. `image` for JPEG, PNG or GIF).\n- Many-to-many polymorphic relationships allow any number of media to be assigned to any number of other models without any need to modify their schema.\n- Attach media to models with tags, in order to set and retrieve media for specific purposes, such as `'thumbnail'`, `'featured image'`, `'gallery'` or `'download'`.\n- Integrated support for integration/image for manipulating image files to create variants for different use cases.\n\n## Example Usage\n\nUpload a file to the server, and place it in a directory on the filesystem disk named \"uploads\". This will create a Media record that can be used to refer to the file.\n\n```php\n$media = MediaUploader::fromSource($request-\u003efile('thumb'))\n\t-\u003etoDestination('uploads', 'blog/thumbnails')\n\t-\u003eupload();\n```\n\nAttach the Media to another eloquent model with one or more tags defining their relationship.\n\n```php\n$post = Post::create($this-\u003erequest-\u003einput());\n$post-\u003eattachMedia($media, ['thumbnail']);\n```\n\nRetrieve the media from the model by its tag(s).\n\n```php\n$post-\u003egetMedia('thumbnail')-\u003efirst()-\u003egetUrl();\n```\n\n## Installation\n\nAdd the package to your Laravel app using composer\n\n```bash\ncomposer require plank/laravel-mediable\n```\n\nRegister the package's service provider in `config/app.php`. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.\n\n```php\n'providers' =\u003e [\n    ...\n    Plank\\Mediable\\MediableServiceProvider::class,\n    ...\n];\n```\n\nThe package comes with a Facade for the image uploader, which you can optionally register as well. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.\n\n```php\n'aliases' =\u003e [\n\t...\n    'MediaUploader' =\u003e Plank\\Mediable\\MediaUploaderFacade::class,\n    ...\n]\n```\n\nPublish the config file (`config/mediable.php`) of the package using artisan.\n\n```bash\nphp artisan vendor:publish --provider=\"Plank\\Mediable\\MediableServiceProvider\"\n```\n\nRun the migrations to add the required tables to your database.\n\n```bash\nphp artisan migrate\n```\n\n## Documentation\n\nRead the documentation [here](http://laravel-mediable.readthedocs.io/en/latest/).\n\n## License\n\nThis package is released under the MIT license (MIT).\n\n## About Plank\n\n[Plank](http://plankdesign.com) is a web development agency based in Montreal, Canada.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplank%2Flaravel-mediable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplank%2Flaravel-mediable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplank%2Flaravel-mediable/lists"}