Download the PHP package anil/file-picker without Composer

On this page you can find all versions of the php package anil/file-picker. 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 file-picker

File Picker

A powerful media library and file picker component for Laravel Livewire. Supports images, videos, audio, documents, and every other file type, all behind a polished modal interface.

Features

Requirements

Installation

file-picker:install publishes config/file-picker.php and runs an additive migration that adds the columns the package needs (folder, tags, is_favorite, hash, width, height, duration, user_id, download_count, custom_properties, deleted_at) to Plank's existing media table. CSS/JS are served via a built-in route — nothing to publish, nothing to compile.

Install command flags

Add stack slots to your layout

The component pushes CSS to @stack('head') and JS to @stack('scripts'):

Quick Start

Usage

In a Livewire component

In a traditional HTML form

With a JavaScript callback

Component Properties

Property Type Default Description
multiple bool false Allow multiple selection
maxFiles int 10 Maximum number of files that can be selected
selected array [] Pre-selected media IDs
allowedTypes array [] Restrict to specific file types (empty = all)
inputName string 'files' Name for the hidden input(s)
inputId string auto ID for the hidden input
formId string '' Form ID to target for auto-submit
autoSubmit bool false Auto-submit the form after selection
callbackFunction string '' Global JS function name called after selection
buttonLabel string auto Override the trigger button label
showPreview bool true Show selected file previews below the button
perPage int 24 Items per page in the media library

Allowed File Types

Restrict the picker via allowedTypes:

Type Extensions
image jpg, jpeg, png, gif, webp, svg, bmp, ico, tiff, avif
video mp4, webm, ogg, mov, avi, mkv, wmv, flv, m4v
audio mp3, wav, aac, ogg, flac, m4a, wma, aiff
document pdf, doc, docx, txt, rtf, odt, md, epub
spreadsheet xls, xlsx, csv, ods, numbers
presentation ppt, pptx, odp, key
archive zip, rar, 7z, tar, gz, bz2, xz
code js, ts, php, html, css, json, yaml, vue, jsx, tsx, py, go, rs, etc.

Extensions per type can be customised in config/file-picker.php under extensions.

Events

JavaScript event

Fired on window after the user confirms a selection:

Each item in selected is an object with id, url, filename, size, extension, file_type, alt, created_at.

Livewire events

Two events fire whenever the selection changes — pick the one that fits your handler shape:

filesSelected — named arguments, easiest for typed signatures:

file-picker-selected — single array payload with the full picker context:

If you have several pickers on one page, switch on $inputName to route the selection to the right property.

Upload Errors

Upload problems are surfaced to the UI at three levels:

  1. Server-side validation (size, mime type) — failures render as a toast plus a per-file list ({filename}: {message}).
  2. Per-file driver failuresDuplicateMediaException, StorageQuotaExceededException, UploadFailedException, or any other Throwable thrown by the driver are aggregated into the toast (e.g. "2 uploaded, 1 failed").
  3. Browser-side failures — the bundled JS listens for livewire-upload-error and forwards the HTTP status:
    • 413"the file is larger than the server allows"
    • 422"the file did not pass validation"
    • other status codes → generic "Upload failed (HTTP …)"

Error toasts are sticky — dismiss with the × button or any new upload action.

To push your own error into the toast (e.g. from a custom driver):

Tablet & Mobile

The library tab uses a side-by-side layout on desktop (≥1025px) with the Attachment Details panel always visible. On tablet/mobile (≤1024px), the panel becomes a right-side sheet that's closed by default — tapping a thumbnail just selects it.

To open the details sheet on touch devices, tap the edit icon that sits next to the selection checkbox on each item. It promotes the item to the active selection (without toggling existing selections off) and slides the sheet in. The icon is hidden on desktop where the sidebar is always inline. Rename it via the texts.view_details config key (or the published lang file).

Drivers

Plank driver (default)

Built on top of plank/laravel-mediable — installed automatically. The bundled FilePickerMedia model extends Plank's Media and the install migration adds the extra columns to Plank's existing media table.

Using a non-public disk? Plank's mediable.allowed_disks config defaults to ['public']. Publish Plank's config (php artisan vendor:publish --tag=mediable-config) and add your disk to allowed_disks.

Custom driver

Implement Anil\LivewireFilePicker\Contracts\MediaDriverInterface (or extend Anil\LivewireFilePicker\Drivers\AbstractDriver) and register the FQCN:

Authorization

Default is "everything allowed." For real apps, plug in an authorization class:

Custom Filters

Add filter controls to the library toolbar in two parts:

1. UI controls in config:

2. The filter class:

Configuration

Publish the config to customise everything:

Key sections:

Text strings

All UI text is configurable. Publish lang files to translate:

Customising Views

Publish blade views to override the UI:

Views are published to resources/views/vendor/file-picker/.

API Reference

Component methods

Method Description
openModal() / closeModal() Open / close the modal
setViewMode('library'\|'trash') Switch between active library and trash
toggleSelection($id) Toggle selection of a media item
viewDetails($id) Promote item to active and open details panel
clearSelection() Clear all selected items
insertSelected() Confirm selection and close modal
uploadFiles() Upload pending files
setUploadError($message) Push an error message into the upload toast
deleteMedia($id) Soft-delete (move to trash)
restoreMedia($id) Restore from trash
forceDeleteMedia($id) Permanently delete (and remove file from disk)
bulkDelete($ids) Soft-delete many at once
toggleFavorite($id) Toggle favorite
addTag() / removeTag($id, $tag) Manage tags
startMoving($id) + saveMove() Move to a folder
bulkMoveToFolder($ids, $folder) Move many at once
startReplacing($id) Replace the underlying file
refreshMedia() Reload media items
clearFilters() Reset search / type / folder / tag / favorite

Facade

Console commands

Download routes

Route Purpose
GET /file-picker/download/{id} Force-download a single file
GET /file-picker/download-zip?ids[]= Stream a zip of selected media

Computed properties

Property Type Description
selectedMediaItems array Full details of selected media
hasSelection bool Whether any items are selected
selectionLabel string Human-readable selection count
selectedCount int Number of selected items

License

The MIT License (MIT). See License File.


All versions of file-picker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3|^8.4|^8.5
illuminate/contracts Version ^13.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/view Version ^11.0|^12.0|^13.0
livewire/livewire Version ^3.0|^4.0
plank/laravel-mediable Version ^6.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 anil/file-picker contains the following files

Loading the files please wait ...