PHPackages                             ehel/laravelfileupload - 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. ehel/laravelfileupload

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

ehel/laravelfileupload
======================

A Laravel package for uploading files via Ajax

0.4(10y ago)0321MITPHP

Since Mar 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ehel/laravelfileupload)[ Packagist](https://packagist.org/packages/ehel/laravelfileupload)[ RSS](/packages/ehel-laravelfileupload/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

\#Laravel Ajax File Upload

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

[](#installation)

Begin by installing this package through Composer:

```
composer require ehel/laravelfileupload

```

Next, add FileUploadServiceProvider to the providers array of config/app.php:

```
'providers' => [
    //...
    Ehel\FileUpload\FileUploadServiceProvider::class,
    //...
];
```

Next, add class alias to the aliases array of config/app.php:

```
  'aliases' => [
    // ...
      'FileUpload' => Ehel\FileUpload\FileUploadFacade::class
    // ...
  ],
```

Finnaly, run :

```
php artisan vendor:publish

```

Usage
-----

[](#usage)

\###Step 1: Generate Buttons

```
{!!FileUpload::buttons($uploadDirectory, $className) !!}
```

\###Step 2: Generate Script

```
{!!FileUpload::script($uploadSuccess, $uploadFail, $deleteSuccess, $deleteFail, $ajaxUploadFail) !!}
```

\##Attention Jquery and Bootstrap are required.

\##Save file path to database Package generate a hidden input with file path, so you can save file path to database.

```

```

\##Example

```
>

        Laravel
