PHPackages                             przwl/multi-source-file-upload - 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. przwl/multi-source-file-upload

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

przwl/multi-source-file-upload
==============================

Plugin that allows multi source file upload include urls and attachments

v1.0.1(7mo ago)31023MITPHPPHP ^8.1

Since Nov 11Pushed 6mo agoCompare

[ Source](https://github.com/prazwal-bns/Plugin-MultiSourceFileUpload)[ Packagist](https://packagist.org/packages/przwl/multi-source-file-upload)[ RSS](/packages/przwl-multi-source-file-upload/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Multi Source File Upload
========================

[](#multi-source-file-upload)

A Filament plugin that enables multi-source file uploads, allowing users to upload files either from their device or via a URL.
Supports conditional required fields and only-image upload restrictions.

---

Features
--------

[](#features)

- **Upload files** from your device or **provide a direct URL**.
- Tabs UI for toggling between upload sources.
- Conditional required validation for both file and URL fields.
- Optionally restrict uploads to images only.
- Monitors file upload to hide/show tabs dynamically.
- Configurable labels, icons, and polling intervals.

---

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

[](#installation)

```
composer require przwl/multi-source-file-upload
```

If you are using Laravel &lt; 10 or not using package discovery, add the service provider:

```
// config/app.php

'providers' => [
    ...
    Przwl\MultiSourceFileUpload\MultiSourceFileUploadServiceProvider::class,
],
```

---

Configuration
-------------

[](#configuration)

Optionally publish the config:

```
php artisan vendor:publish --tag="multi-source-file-upload-config"
```

You can customize:

- Poll interval (`poll_interval`)
- Labels (`labels.file_upload`, `labels.url_upload`)
- Icons (`icons.file_upload`, `icons.url_upload`)

```
// config/multi-source-file-upload.php

return [
    'poll_interval' => 50, // ms
    'labels' => [
        'file_upload' => 'File Upload',
        'url_upload' => 'URL Upload',
    ],
    'icons' => [
        'file_upload' => 'heroicon-o-arrow-up-tray',
        'url_upload' => 'heroicon-o-globe-alt',
    ]
];
```

---

Usage
-----

[](#usage)

In your Filament form, use the `MultiSourceFileUpload` component by spreading its schema into your form.

### Complete Example

[](#complete-example)

```
use Filament\Forms\Form;
use Przwl\MultiSourceFileUpload\Components\MultiSourceFileUpload;

public function form(Form $form): Form
{
    return $form
        ->schema([
            TextInput::make('title')
                ->required(),

            // Use the multi-source file upload component
                ...(MultiSourceFileUpload::make('image', 'image_url')
                    ->required()
                    ->image())
                    ->getSchema(),

            // Other form fields...
        ]);
}
```

Both "file" and "url" tabs are coordinated: uploading a file clears the URL; supplying a URL clears the file field.

> **Important:** Make sure to set the database fields (e.g., `image` and `image_url`) to `->nullable()` in your migration file, since only one field will be filled at a time.

```
// Example migration
Schema::create('your_table', function (Blueprint $table) {
    $table->id();
    $table->string('image')->nullable();
    $table->string('image_url')->nullable();
    // ...
});
```

---

How It Works
------------

[](#how-it-works)

- The plugin uses a **Tabs** interface for "File" and "URL" upload.
- When a file is uploaded, the URL field is disabled, and vice versa.
- Only one source can be filled at a time.
- Uses Alpine.js for hiding the tab when a file upload is detected.
- Poll interval for DOM updates is configurable in the config.

---

Advanced
--------

[](#advanced)

You can customize required logic or column span (see the implementation for details):

```
  ...(MultiSourceFileUpload::make('image', 'image_url')
    ->required()
    ->image())
    ->getSchema(),
```

---

License
-------

[](#license)

MIT

---

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance65

Regular maintenance activity

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

2

Last Release

221d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/100463229?v=4)[Prajwal Banstola](/maintainers/prazwal-bns)[@prazwal-bns](https://github.com/prazwal-bns)

---

Top Contributors

[![prazwal-bns](https://avatars.githubusercontent.com/u/100463229?v=4)](https://github.com/prazwal-bns "prazwal-bns (20 commits)")

### Embed Badge

![Health badge](/badges/przwl-multi-source-file-upload/health.svg)

```
[![Health](https://phpackages.com/badges/przwl-multi-source-file-upload/health.svg)](https://phpackages.com/packages/przwl-multi-source-file-upload)
```

###  Alternatives

[illuminate/filesystem

The Illuminate Filesystem package.

16165.0M3.2k](/packages/illuminate-filesystem)[althinect/filament-spatie-roles-permissions

3481.1M10](/packages/althinect-filament-spatie-roles-permissions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
