LaravelPackages.net
Acme Inc.
Toggle sidebar
spescina/mediabrowser

Laravel packages that provide a basic user interface for browsing a server folder, for uploading files and for picking a file

575
14
4.0.2
About spescina/mediabrowser

spescina/mediabrowser is a Laravel package for laravel packages that provide a basic user interface for browsing a server folder, for uploading files and for picking a file. It currently has 14 GitHub stars and 575 downloads on Packagist (latest version 4.0.2). Install it with composer require spescina/mediabrowser. Discover more Laravel packages by spescina or browse all Laravel packages to compare alternatives.

Last updated

Build Status Coverage Status

MediaBrowser

Laravel 5.2 package that provide a basic user interface for browsing a server folder, for uploading files and for picking a file

MediaBrowser preview

Install && Usage

Run composer require spescina/mediabrowser

Add the service provider in the config/app.php file

Spescina\Mediabrowser\Providers\MediabrowserServiceProvider::class

Publish the package assets running php artisan vendor:publish

Mediabrowser uses Fancybox as IFrame popup loader and for this reason requires jQuery.

Include in your template files Mediabrowser stylesheets

<link media="all" type="text/css" rel="stylesheet" href="http://localhost/packages/spescina/mediabrowser/dist/mediabrowser-include.min.css">

and scripts

<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="https://raw.githubusercontent.com/spescina/mediabrowser/refs/heads/main//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://localhost/packages/spescina/mediabrowser/dist/mediabrowser-include.min.js"></script>

Now you have to insert an input field and a button for the fancybox trigger, for example

<input type="text" name="yourfield" value="uploads/image.jpg" class="form-control" />
<span class="input-group-btn">
        <a data-fancybox-type="iframe" href="{{ route('mediabrowser', array('yourfield', 'uploads/image.jpg')) }}" class="btn btn-default mediabrowser-js" type="button"><span class="glyphicon glyphicon-folder-open"></span></a>
</span>

Notes

  • The library url can be generated through the mediabrowser named route. It accepts two parameters, field name and optionally the selected value.
  • Mediabrowser is configured for loading optimized assets when your laravel application is not in debug mode.
Comments