PHPackages                             hitesh399/laravel-media - 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. hitesh399/laravel-media

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

hitesh399/laravel-media
=======================

Laravel Media Popup to upload/view the files

v1.0.1(7y ago)11.8kJavaScript

Since Sep 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/hitesh399/laravel-media)[ Packagist](https://packagist.org/packages/hitesh399/laravel-media)[ Docs](https://github.com/hitesh399/laravel-media)[ RSS](/packages/hitesh399-laravel-media/feed)WikiDiscussions master Synced yesterday

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

How to install and configure the package into your project
==========================================================

[](#how-to-install-and-configure-the-package-into-your-project)

composer require hitesh399/laravel-media

Add the provider into the config/app.php file
---------------------------------------------

[](#add-the-provider-into-the-configappphp-file)

```
Collective\Html\HtmlServiceProvider::class,
Hitesh399\LaravelMedia\LaravelMediaServiceProvider::class,

```

Add the alias in the config/app.php file
----------------------------------------

[](#add-the-alias-in-the-configappphp-file)

```
'Form' => Collective\Html\FormFacade::class,
'Html' => Illuminate\Support\Facades\Html::class,

```

To publish the vendor and update the database schema you can execute the below-mentioned commands:(You also need to install the node and npm)
---------------------------------------------------------------------------------------------------------------------------------------------

[](#to-publish-the-vendor-and-update-the-database-schema-you-can-execute-the-below-mentioned-commandsyou-also-need-to-install-the-node-and-npm)

```
php artisan vendor:publish --tag=laravel-media //to publish the vendor
php artisan migrate // update the database schema
npm install //Download and install the dependency
npm install --save-dev @fortawesome/fontawesome-free //to download font awesome

```

To compile the media files, add the below line into the webpack.mix.js file
---------------------------------------------------------------------------

[](#to-compile-the-media-files-add-the-below-line-into-the-webpackmixjs-file)

```
require('./laravel.media.webpack.mix');

```

To generate the script/css execute the below mentioned command
--------------------------------------------------------------

[](#to-generate-the-scriptcss-execute-the-below-mentioned-command)

```
npm run dev

```

Put the filesystem driver in .env file
--------------------------------------

[](#put-the-filesystem-driver-in-env-file)

```
FILESYSTEM_DRIVER=public //file driver for upload the data

```

Configure the config/filesystems.php as shown below
---------------------------------------------------

[](#configure-the-configfilesystemsphp-as-shown-below)

```
'public' => [
    'driver' => 'local',
    'root' => public_path('storage'),
    'url' => env('APP_URL').'/storage',
    'visibility' => 'public',
],

```

To create the storage link execute the below-mentioned command
--------------------------------------------------------------

[](#to-create-the-storage-link-execute-the-below-mentioned-command)

```
php artisan storage:link

```

Define the global variable by adding below-mentioned script in between the head tag
-----------------------------------------------------------------------------------

[](#define-the-global-variable-by-adding-below-mentioned-script-in-between-the-head-tag)

```

     window.site = {
       'site_url':'{!!url('/')!!}',
       'base_url':'{!!asset('/')!!}',
       'storage_url':'{!!Storage::url('/')!!}',
       'admin_url':'{!!url('/admin')!!}',
     };

```

To use the media popup, include the jquery and bootstrap framework css/js files and also add the below-mentioned script file.
-----------------------------------------------------------------------------------------------------------------------------

[](#to-use-the-media-popup-include-the-jquery-and-bootstrap-framework-cssjs-files-and-also-add-the-below-mentioned-script-file)

```

```

Create the Controller
---------------------

[](#create-the-controller)

```
