PHPackages                             devwizardhq/laravel-filex - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. devwizardhq/laravel-filex

ActiveLibrary[File &amp; Storage](/categories/file-storage)

devwizardhq/laravel-filex
=========================

laravel-filex is a powerful and reusable Blade component that brings modern, asynchronous file uploads to Laravel applications. It supports features like drag-and-drop uploads, real-time progress indicators, preview rendering, chunked upload for large files, and temporary file handling with finalization on form submission.

v1.2.0(2w ago)776↓100%1[1 PRs](https://github.com/DevWizardHQ/laravel-filex/pulls)MITPHPPHP ^8.1|^8.2|^8.3|^8.4CI failing

Since Jul 11Pushed 1w agoCompare

[ Source](https://github.com/DevWizardHQ/laravel-filex)[ Packagist](https://packagist.org/packages/devwizardhq/laravel-filex)[ Docs](https://github.com/devwizardhq/laravel-filex)[ GitHub Sponsors](https://github.com/DevWizard)[ RSS](/packages/devwizardhq-laravel-filex/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (12)Versions (7)Used By (0)

Laravel Filex
=============

[](#laravel-filex)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1b7e714148a8df284cfd46b287cc748c032d38e143ce27096e4196b7e5d7a289/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64657677697a61726468712f6c61726176656c2d66696c65782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devwizardhq/laravel-filex)[![GitHub Tests Action Status](https://camo.githubusercontent.com/dc3735d9a82d21f26f19f9b17adfd681cc96482b3b53f524a51fc3739166c92a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64657677697a61726468712f6c61726176656c2d66696c65782f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/devwizardhq/laravel-filex/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4affca6a8a334d6f4610390c5051ac5b9b0d332cbffcf62f6b2d874086cd49b5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64657677697a61726468712f6c61726176656c2d66696c65782f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/devwizardhq/laravel-filex/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/90a9f6ef193e176312bd8db922b6f3237bafbac8542d3fe3056c85fd5e1a7ef9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64657677697a61726468712f6c61726176656c2d66696c65782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devwizardhq/laravel-filex)

**Laravel Filex** is a powerful, modern, and enterprise-grade file upload component for Laravel applications. Built on top of Dropzone.js, it provides a seamless drag-and-drop file upload experience with advanced features including chunked uploads, real-time progress tracking, comprehensive security validation, temporary file handling, quarantine system, and intelligent file management.

🚀 Features
----------

[](#-features)

- **🎯 Easy Integration**: Drop-in Blade component for instant file upload functionality
- **📁 Drag &amp; Drop**: Modern drag-and-drop interface with visual feedback and animations
- **📊 Progress Tracking**: Real-time upload progress with visual indicators and completion states
- **🔄 Chunked Uploads**: Handle large files with automatic chunking for better performance and reliability
- **⏱️ Temporary Storage**: Safe temporary file handling with automatic expiration and cleanup
- **🔒 Advanced Validation**: Multi-layer client-side and server-side validation with custom rules
- **🛡️ Security Features**: File signature validation, threat detection, quarantine system, and malicious content scanning
- **🎨 Highly Customizable**: Extensive configuration options, theming, and styling flexibility
- **☁️ Cloud Ready**: Support for local, S3, and other Laravel storage drivers with streaming
- **🌐 Multi-language Support**: Built-in localization for multiple languages (English, Bengali, with more coming)
- **🧹 Auto Cleanup**: Scheduled cleanup of orphaned temporary files and quarantined content
- **⚡ Performance Optimized**: Lazy loading, intelligent caching, bulk operations, and memory management
- **🔄 Retry Logic**: Automatic retry mechanism for failed uploads with exponential backoff
- **📱 Responsive Design**: Mobile-friendly interface that works across all devices
- **🎛️ Rich API**: Comprehensive API for programmatic file management and operations
- **📈 Performance Monitoring**: Built-in performance metrics and optimization tools
- **🚨 Error Handling**: Comprehensive error handling with detailed feedback and logging

📋 Requirements
--------------

[](#-requirements)

- PHP 8.1+
- Laravel 11.x, or 12.x
- Minimum 256MB memory (recommended 512MB or higher for large files)
- File system write permissions for temporary storage
- Modern web browser with JavaScript support

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require devwizardhq/laravel-filex
```

### Quick Setup (Recommended)

[](#quick-setup-recommended)

The package automatically publishes its configuration and assets when installed. For manual installation or to republish files:

```
# Install with automatic asset publishing
php artisan filex:install

# Manual installation options
php artisan filex:install --force          # Force overwrite existing files
php artisan filex:install --only-config    # Only publish configuration
php artisan filex:install --only-assets    # Only publish assets
php artisan filex:install --auto          # Silent installation
```

### Asset Integration

[](#asset-integration)

Add the assets directive to your main layout file:

```
@filexAssets
```

This directive automatically includes all required CSS, JavaScript, and route configurations with performance optimizations.

🔧 Basic Usage
-------------

[](#-basic-usage)

### Simple File Upload

[](#simple-file-upload)

```

    @csrf

    Submit

```

### Multiple File Upload

[](#multiple-file-upload)

```

```

### Advanced Configuration

[](#advanced-configuration)

```

```

🎛️ Component Props
------------------

[](#️-component-props)

PropertyTypeDefaultDescription`name`string'files'Input name for form submission`multiple`booleanfalseAllow multiple file selection`accept`stringnullAccepted file types (MIME types or extensions)`maxFiles`integernullMaximum number of files allowed`maxSize`integer10Maximum file size in MB`minSize`integernullMinimum file size in MB`required`booleanfalseMake the field required`disabled`booleanfalseDisable the uploader`readonly`booleanfalseMake the uploader read-only### UI Customization Props

[](#ui-customization-props)

PropertyTypeDefaultDescription`label`stringnullField label`placeholder`stringnullPlaceholder text`helpText`stringnullHelp text below the field`showProgress`booleantrueShow upload progress`showFileSize`booleantrueShow file sizes`allowPreview`booleantrueEnable file previews`showSuccessMessages`booleanfalseShow success notifications`showErrorNotifications`booleantrueShow error notifications`errorTimeout`integer5000Error message timeout (ms)`successTimeout`integer3000Success message timeout (ms)`class`string''Additional CSS classes`style`string''Inline styles`wrapperClass`string''Wrapper element CSS classes### Validation Props

[](#validation-props)

PropertyTypeDefaultDescription`rules`array\[\]Laravel validation rules`mimes`stringnullAllowed MIME types`extensions`stringnullAllowed file extensions`dimensions`array/stringnullImage dimension constraints`clientValidation`booleantrueEnable client-side validation### Upload Behavior Props

[](#upload-behavior-props)

PropertyTypeDefaultDescription`autoProcess`booleantrueAuto-process uploaded files`parallelUploads`integer2Number of parallel uploads`chunkSize`integer1048576Chunk size for large files (bytes)`retries`integer3Number of retry attempts`timeout`integer30000Upload timeout (ms)`thumbnailWidth`integer120Thumbnail width for previews`thumbnailHeight`integer120Thumbnail height for previews`thumbnailMethod`string'contain'Thumbnail resize method### Event Props

[](#event-props)

PropertyTypeDescription`onSuccess`stringJavaScript function called on successful upload`onError`stringJavaScript function called on upload error`onComplete`stringJavaScript function called when upload completes`onFileAdded`stringJavaScript function called when file is added`onFileRemoved`stringJavaScript function called when file is removed`onUpload`stringJavaScript function called during upload progress### Debug and Testing Props

[](#debug-and-testing-props)

PropertyTypeDefaultDescription`debug`booleanfalseEnable debug mode for detailed logging`value`array/string\[\]Pre-populated file paths for editing🏗️ Processing Uploads in Controllers
------------------------------------

[](#️-processing-uploads-in-controllers)

### Using the HasFilex Trait

[](#using-the-hasfilex-trait)

The `HasFilex` trait provides a clean, simple API for file upload operations:

```
