aspectox/ax-filebrowser

A file browser package for Laravel applications

Maintainers

Package info

github.com/AspectoX/ax-filebrowser

Language:Blade

pkg:composer/aspectox/ax-filebrowser

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-06-14 22:28 UTC

This package is auto-updated.

Last update: 2026-07-14 22:38:15 UTC


README

A full-featured file manager package for Laravel applications. Browse, upload, organize, and manage files directly from your app with support for metadata, image editing, galleries, and an embeddable file picker.

Features

  • Browse folders and files with list and gallery views
  • Upload files or link external URLs
  • Create, rename, move, copy, and delete files and folders
  • Upload image galleries (multiple files to a new folder in one step)
  • File metadata: author, source URL, date, description, tags
  • Built-in image editor (crop, rotate, flip, resize, brightness/contrast/saturation, filters)
  • File search and filtering by type, extension, author, and size
  • Embeddable file picker (for use in CKEditor, TinyMCE, custom inputs, etc.)
  • Disk usage stats
  • Breadcrumb navigation and sidebar folder tree
  • Multilingual: English and Spanish included

Requirements

  • PHP 8.3+
  • Laravel 13.x

Installation

Install via Composer:

composer require aspectox/ax-filebrowser

Laravel will auto-discover the service provider. Then run the migrations:

php artisan migrate

Publish the assets (CSS and JS):

php artisan vendor:publish --tag=ax-filebrowser-assets

This copies the CSS and JS files to public/vendor/ax-filebrowser/.

Layout Integration

The package views use @push('styles') and @push('scripts') to inject assets into your layout. For this to work, your layout must include the corresponding @stack directives.

Add @stack('styles') inside your <head> tag and @stack('scripts') before </body>:

{{-- In your layout head partial --}}
@stack('styles')

{{-- In your layout before </body> --}}
@stack('scripts')

Once the assets are published and the stacks are in place, navigate to /ax-filebrowser — the file browser will render inside your app's layout automatically.

Publishing other resources

Publish only what you need:

# Config file
php artisan vendor:publish --tag=ax-filebrowser-config

# Blade views (to customize them)
php artisan vendor:publish --tag=ax-filebrowser-views

# Language files
php artisan vendor:publish --tag=ax-filebrowser-lang

# Everything at once (config + assets)
php artisan vendor:publish --tag=ax-filebrowser

Configuration

After publishing the config, edit config/ax-filebrowser.php:

return [
    // Root uploads folder, relative to public/
    // Example: 'uploads' → public/uploads
    'uploads_folder' => 'uploads',

    // Label shown in the sidebar and breadcrumb
    // Leave empty to use the folder name automatically
    'root_name' => '',
];

Usage

File Browser

Navigate to /ax-filebrowser in your application. The route is registered automatically.

File Picker

The picker is designed to be embedded in rich text editors or custom file inputs. Open it via:

/ax-filebrowser/picker?callback=myCallbackFunction

The callback parameter is the name of the JavaScript function that will receive the selected file path.

Example with a plain input:

<input type="text" id="file-input" value="">
<button onclick="openPicker()">Browse</button>

<script>
function openPicker() {
    window.open(
        '/ax-filebrowser/picker?callback=onFilePicked',
        'picker',
        'width=1000,height=700'
    );
}

function onFilePicked(path) {
    document.getElementById('file-input').value = path;
}
</script>

Available Routes

Method URI Name Description
GET /ax-filebrowser ax.index Main file browser view
GET /ax-filebrowser/picker ax.picker Embeddable file picker
GET /ax-filebrowser/search ax.search Search files
GET /ax-filebrowser/disk-usage ax.disk.usage Disk usage stats (JSON)
POST /ax-filebrowser/upload ax.upload Upload a file or link a URL
POST /ax-filebrowser/upload-gallery ax.upload.gallery Upload image gallery
POST /ax-filebrowser/folder/store ax.folder.store Create folder
POST /ax-filebrowser/folder/rename ax.folder.rename Rename folder
POST /ax-filebrowser/folder/delete ax.folder.delete Delete folder
POST /ax-filebrowser/rename ax.rename Rename file or folder
POST /ax-filebrowser/move ax.move Move file or folder
POST /ax-filebrowser/copy ax.copy Copy file or folder
GET /ax-filebrowser/metadata-fetch ax.metadata.fetch Get file metadata (JSON)
POST /ax-filebrowser/metadata-fetch ax.metadata.save Save file metadata (JSON)
POST /ax-filebrowser/image/save ax.image.save Save edited image
POST /ax-filebrowser/delete/{id} ax.file.delete Delete file by metadata ID
POST /ax-filebrowser/delete-by-path ax.file.delete.path Delete file by path

File Metadata

Each file can store the following metadata:

Field Description
autor Author or credit
credito_url Source URL
fecha_archivo File date
epigrafe Description / caption
tags Comma-separated tags

Localization

The package ships with English and Spanish. To add another language, publish the lang files and add a new folder:

php artisan vendor:publish --tag=ax-filebrowser-lang

This creates lang/vendor/ax-filebrowser/{locale}/ax-filebrowser.php. Duplicate the en file and translate.

Editor Integration

The file picker can be integrated with popular rich text editors and inputs, including:

  • CKEditor 4
  • TinyMCE 6 / 7
  • TipTap
  • Filament (RichEditor and TipTap Editor for Filament)
  • Quill
  • Plain textarea / text input

Each integration uses a universal callback system: when a file is selected, the picker calls window[callbackName](code, url, name), where code is a ready-to-insert HTML tag, url is the file path, and name is the filename.

For detailed setup instructions and code examples for each editor, see public/vendor/editor-plugins/integration.md.

Support / Donations

If this package was useful to you, please consider making a donation. Any contribution is greatly appreciated!

License

MIT — see LICENSE for details.