New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

albert221/laravel-filepond

FilePond upload handler with more features.
1,040 10
Install
composer require albert221/laravel-filepond
Latest Version:v1.0.2
PHP:^7.4
Laravel:7
License:Apache-2.0
Last Updated:May 13, 2021
Links: GitHub  ·  Packagist
Maintainer: Albert221

Albert221/laravel-filepond

Packagist GitHub Workflow Status

This package provides basic FilePond Laravel functionality and helps handle files sent with JS disabled.

This package was written in a real hurry. It may not be well documented or well tested, but should work. Pull Requests fixing that are welcome.

Installation

composer require albert221/laravel-filepond

If you need to change configuration:

php artisan vendor:publish --provider="Albert221\Filepond\FilepondServiceProvider"

Usage

Frontend

FilePond.setOptions({
  server: '/filepond'
});

Backend

// app/Http/Controllers/SomeController.php

public function someAction(Request $request, Filepond $filepond)
{
    // Thanks to `fromRequest` method, it works both when JS was on and off.
    /** @var UploadedFile|[]UploadedFile $file */
    $file = $filepond->fromRequest($request, 'file');
    
    // (...)
}
Validation
// app/Http/Requests/SomeRequest.php

public function rules(FilepondSerializer $filepondSerializer): array
{
    return [
        'foobar' => 'required',
        'file' => [
            'required',
            // It validates both UploadedFile and FilePond's serverId
            new FilepondRule($filepondSerializer, [
                'mimetypes:audio/mpeg'
            ]),
        ],
    ];
}

License

This project was heavily inspired by Sopamo/laravel-filepond.

This project is on Apache 2.0 license.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

660,512,042 9,702
laravel/framework

The Laravel Framework.

625,568,548 34,998
laravel/tinker

Powerful REPL for the Laravel framework.

531,591,559 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

450,320,528 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

424,642,029 4,662

Version History

Version Released PHP Laravel License
v1.0.2 ^7.4 ^7.0 Apache-2.0
v1.0.0 ^7.4 ^7.0 Apache-2.0