Download the PHP package inlayphp/media without Composer

On this page you can find all versions of the php package inlayphp/media. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package media

Inlay Media

Packagist PHP

Secure, framework-grade media catalog and upload domain for Inlay

inlayphp/media is an official optional Inlay package and a storage-agnostic media catalog for Laravel applications. It owns uploaded objects, database metadata, logical folders, visibility, trash/restore, and transformation hooks. It does not provide an admin UI; install inlayphp/media-manager when you need a panel browser and picker.

Package boundary

Media is deliberately outside the Inlay core. A clean Inlay installation does not create media tables, choose a filesystem disk, or add upload behavior until this package is installed. Conversely, inlayphp/media can be used in a Laravel application without installing Inlay Panels, React, Vue, or the media manager.

This package owns:

It intentionally does not own HTTP routes, authorization policy, an Inertia payload, a browser/picker UI, or Spatie collections. Those boundaries belong to the host application, inlayphp/media-manager, and inlayphp/media-spatie respectively.

Install

The published asset migration uses 50-character disk names and 500-character object paths so the composite uniqueness key remains valid on MySQL with utf8mb4, including Laravel Cloud's default database configuration. The folder and asset table creation is guarded with Schema::hasTable() so a deployment can safely finish a migration that created the folder table before the migration record was written.

That is the complete clean-core installation. No panel plugin registration or JavaScript package is required for service-level use. Laravel package discovery registers MediaServiceProvider; applications which disable discovery may register Inlay\Media\MediaServiceProvider manually.

Laravel discovers Inlay\Media\MediaServiceProvider. Publish configuration only when the defaults need changing:

Important environment settings are INLAY_MEDIA_DISK, INLAY_MEDIA_DIRECTORY, INLAY_MEDIA_VISIBILITY, and INLAY_MEDIA_MAX_SIZE_KB. The default catalog uses the local disk, stores below media/YYYY/MM, permits files up to 10 MB, and creates private assets. Allowed MIME types and extensions are independent allow-lists in config/media.php.

Upload files

MediaUploader accepts Laravel's trusted UploadedFile, an optional logical folder, arbitrary JSON metadata, and an optional visibility override:

The service detects MIME type and extension from file contents, enforces both allow-lists and the size limit, strips path/control characters from the display name, and writes to a UUID object key. The client filename is never used as a storage path. If catalog persistence fails, the newly written object is removed.

Catalog models and contract

MediaAsset implements MediaAssetContract and exposes key(), disk(), path(), mimeType(), size(), visibility(), and metadata(). It belongs to an optional MediaFolder; folders support parent, children, and assets relationships. Both models use soft deletes.

Applications can extend either model:

Custom models should extend Inlay\Media\Models\MediaAsset and Inlay\Media\Models\MediaFolder respectively so the configured relationships and services retain their model contracts. Packages which only read catalog assets should type against MediaAssetContract.

Organize, trash, and restore

Use MediaLibrary for stateful operations:

Folders are logical: moving an asset updates folder_id without copying its object. Folder moves reject self/descendant cycles. Trash only soft-deletes the catalog record and leaves the object available for restore. Permanent deletion removes the object first and force-deletes the row only after storage reports success. Visibility changes update storage and the row; a database failure attempts to restore the original storage visibility.

Transformations

Implement MediaTransformer for thumbnails, metadata extraction, virus-scan dispatch, or other post-upload work:

Transformers run after the object and asset row exist. A transformer owns its own retry/compensation behavior. They run synchronously by default, or can be queued without changing the transformer contract:

When enabled, MediaUploader dispatches Inlay\Media\Jobs\TransformMediaAsset after catalog persistence. The serialized job contains only the configured asset model class and primary key; the worker resolves the current asset and the shared TransformerRegistry. Generated variants may be recorded in metadata or managed by inlayphp/media-spatie.

Usage references

The catalog cannot infer arbitrary application relationships. Integrations can register a resolver that returns safe, server-authored MediaReference values:

The manager caps the payload with media-manager.max_references_per_asset (50 by default). References are advisory UI links, not authorization boundaries—application routes must still authorize access.

Security

Testing

The monorepo package suite uses Pest:

For application tests, use Storage::fake(), UploadedFile::fake(), and assert both the catalog row and physical object. Related packages are inlayphp/media-manager for panel UI and inlayphp/media-spatie for zero-copy Spatie Media Library integration.


All versions of media with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/config Version ^12.0 || ^13.0
illuminate/contracts Version ^12.0 || ^13.0
illuminate/database Version ^12.0 || ^13.0
illuminate/filesystem Version ^12.0 || ^13.0
illuminate/http Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package inlayphp/media contains the following files

Loading the files please wait ...