Coder Social home page Coder Social logo

laravel-filepond's Introduction

Laravel FilePond Backend

An all in one Laravel backend for FilePond

We currently support the `process` and `revert` methods and are securing those via the Laravel encryption/decryption methods.

๐Ÿš€ Be up and running in 2 minutes

Laravel setup

Require this package in the composer.json of your Laravel project.

composer require sopamo/laravel-filepond

If you need to edit the configuration, you can publish it with:

php artisan vendor:publish --provider="Sopamo\LaravelFilepond\LaravelFilepondServiceProvider"

Included in this repo is a Filepond upload controller which is where you should direct uploads to. Upon upload the controller will return the $serverId which Filepond will send via a hidden input field (same name as the img) to be used in your own controller to move the file from temporary storage to somewhere permanent using the getPathFromServerId($request->input('image')) function.

// Get the temporary path using the serverId returned by the upload function in `FilepondController.php`
$filepond = app(Sopamo\LaravelFilepond\Filepond::class);
$path = $filepond->getPathFromServerId($serverId);

// Move the file from the temporary path to the final location
$finalLocation = public_path('output.jpg');
\File::move($path, $finalLocation);

Filepond setup

Set at least the following Filepond configuration:

FilePond.setOptions({
  server: {
    url: '/filepond/api',
    process: '/process',
    revert: '/process',
    headers: {
      'X-CSRF-TOKEN': '{{ csrf_token() }}'
    }
  }
});

laravel-filepond's People

Contributors

anasmirza534 avatar carloct avatar diyandev avatar keatliang2005 avatar mikemand avatar randhipp avatar rifrocket avatar sopamo avatar tomcrofty avatar tomhorvat avatar xerod avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.