PHPackages                             donia-shaker/media-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. donia-shaker/media-library

ActiveLibrary

donia-shaker/media-library
==========================

v2.0.4(7mo ago)11.3kMITPHP

Since May 13Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/donia-shaker/media-library)[ Packagist](https://packagist.org/packages/donia-shaker/media-library)[ RSS](/packages/donia-shaker-media-library/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (8)Used By (0)

Media Library
=============

[](#media-library)

This package provides a set of functions for handling media files, including images, audio, video, and PDF files.

- [Media Library](#media-library)
    - [Features](#features)
    - [Installation](#installation)
    - [Usage](#usage)
        - [Initialization](#initialization)
        - [Save Image](#save-image)
        - [Create Temporary Image](#create-temporary-image)
        - [Convert Temporary Image](#convert-temporary-image)
        - [Delete Temporary Image](#delete-temporary-image)
        - [Save Audio File](#save-audio-file)
        - [Save Video File](#save-video-file)
        - [Save Document File](#save-document-file)
    - [Media Object](#media-object)
    - [Rules](#rules)
        - [Square Image](#square-image)
    - [Troubleshooting and Collaboration](#troubleshooting-and-collaboration)

Features
--------

[](#features)

- **Versatile Storage Options**: Seamlessly store and manage your files in both public and private storage environments.
- **Image Conversion Made Easy**: Effortlessly convert and store images in multiple formats to suit all your needs.
- **Automatic Thumbnail Generation**: Instantly create and manage image thumbnails upon upload, saving you time and effort.
- **Universal File Storage**: Store and organize any file type, including documents, videos, and audio files.
- **Soft Delete Support**: Safeguard your data with soft delete functionality, allowing you to restore accidentally deleted files easily.
- **URL Generation**: Instantly generate shareable URLs for your files, making it simple to share and access your stored content.
- **Image Upload Rules**: Ensure optimal performance and quality with customizable image upload rules, including dimensions, size, and format restrictions.

Installation
------------

[](#installation)

To install the `DoniaShaker\MediaLibrary` package, follow these steps:

1. Add the package to your Laravel project using Composer:

    ```
    composer require donia-shaker/media-library
    ```
2. Publish the Database migrations and config to your project:

    ```
    php artisan vendor:publish --tag=media-library-migrations
    php artisan vendor:publish --tag=media-library-config
    ```
3. If you wish to use a default format other than the default webp format, edit the following line in `config/media-library.php`

    ```
    default_image_format = 'webp' //
