Download the PHP package itskodinger/midia without Composer
On this page you can find all versions of the php package itskodinger/midia. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download itskodinger/midia
More information about itskodinger/midia
Files in itskodinger/midia
Package midia
Short Description Simple Media manager for your Laravel project
License MIT
Informations about the package midia
Midia
Simple media manager for your Laravel project. This package lets you open your files as inline modal. All directories in the folder will be ignored. In other words, can only read the file.
Features
- Fully responsive
- Read, rename, delete file
- Infinite scroll
- Search
- Upload multiple
- Multiple thumbnail sizes
- Multiple directories
- Multiple instance
- Configurable
- More ...
Todo List
- [ ] Multiple images selection
- [ ] Multi language
- [ ] Multi user
- [ ] UI improvement
- [x] Thumbnail
Requirements
- PHP >= 5.6.4
- jQuery >= 1.12 (Recommended: 1.12)
- intervention/image
- Dropzone.js
- Laravel 5
Tested
- [x] Laravel 5.7
- [ ] Laravel 5.6
- [x] Laravel 5.5
- [x] Laravel 5.4
- [ ] Laravel 5.3
- [ ] Laravel 5.2
- [ ] Laravel 5.1
- [ ] Laravel 5.0
Installation
Now, this package is available for production. You can install this package using these steps.
- Install through Composer
If you're using Laravel 5.6 you can skip this step, since it will be auto discovered by Laravel.
-
Put this line into
config/app.php
in theproviders
key - Done!
Usage
-
Publish required assets.
-
Put this code in the
<head>
tag -
Add these lines before the
</head>
tag - Make sure you've included jQuery before and put these lines after jQuery
Note: Default, all files that are read and uploaded will be stored in the storage/media
folder, so create a folder named media
in the storage
folder if you have not already created it or you can change the location of the folders you want in config/midia.php
.
Integration
Here we have documented how to use it with TinyMCE 4 and as a stand-alone button. But, you can also try it yourself to be integrated with other editors like: CKEditor, Summernote, etc.
If you successfully integrate with other editors, then you can either create issue
or change the readme.md
file to document how you do it.
TinyMCE 4
Summernote
Standalone Button
Popup
Inline
Multiple Instance With Different Directories
You can also use the configuration in .midia()
. The following is the default configuration:
or you can use data-attributes to change the settings, use data-midia
followed by your setting attributes, i.e. data-midia-your_setting_want_to_change
:
Override Default Settings
You can override default settings for all instances by add following code before creating instance:
Setter
You can also change to settings on the fly but you have to refresh after that:
Getter
You can get the the value from this following Midia Attributes:
- el: get the dom elements
- settings: get the settings
- value: get the value, after you pick a file
with this way:
Methods
Midia has this following methods:
- refresh: refresh your midia, including empty the value, and implement the settings you change before.
- open: open the midia dialog modal
- close: close the midia dialog modal
with this way:
Open The File
To open a file in the browser, you can do it easily like this:
For example:
Note: You can change the media
prefix in the config/midia.php
file
Resize Image On The Fly
You can quickly resize an image, set the width
parameters to the size you want (in pixels) and set the height
parameters to the size you want. If the width
parameter is not set, it will be set equal to the height
parameter and If the height
parameter is not set, it will be set equal to the width
parameter.
Note: Resizing an image over its original size may make the image blurry
Configuration
You can change the default configuration in the config/midia.php
file.
Authors
This package was first initialized by @nauvalazhar and maintained by @itskodinger. Then, it became extraordinary by all contributors: @rizalfakhri12 @mrofi @captainspain @zeroseed @tpaksu