Download the PHP package hitesh399/laravel-media without Composer
On this page you can find all versions of the php package hitesh399/laravel-media. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download hitesh399/laravel-media
More information about hitesh399/laravel-media
Files in hitesh399/laravel-media
Download hitesh399/laravel-media
More information about hitesh399/laravel-media
Files in hitesh399/laravel-media
Vendor hitesh399
Package laravel-media
Short Description Laravel Media Popup to upload/view the files
License
Homepage https://github.com/hitesh399/laravel-media
Package laravel-media
Short Description Laravel Media Popup to upload/view the files
License
Homepage https://github.com/hitesh399/laravel-media
Please rate this library. Is it a good library?
Informations about the package laravel-media
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 alias in the config/app.php file
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 compile the media files, add the below line into the webpack.mix.js file
To generate the script/css execute the below mentioned command
Put the filesystem driver in .env file
Configure the config/filesystems.php as shown below
To create the storage link execute the below-mentioned command
Define the global variable by adding below-mentioned script in between the head tag
To use the media popup, include the jquery and bootstrap framework css/js files and also add the below-mentioned script file.
Create the Controller
Add the below-listed line in route file to define the media routes
To get started, add the below-listed line in html file
How to use the media pop and also override the features
Use the function Form::laravelMedia($name, $label, $data, $listmaker, $htmlrender, $options)
$name [string] -> pass name of element
$label [string] -> pass the lebel of element
$listmaker[string] -> javascript function, to modify the slected file html, the callback function should be define in javascript with four arguments Like:
function listmaker(hiddenFields, file, index, elementName) => HTML
hiddenFields [html] -> contains the html of file hidden fields,
file [Object] -> Object of selected file
index [integer] -> index of selected file
elemengtName [string] -> media field name
Note: in this function you have to renturn the HTMl
$htmlrender [string] -> javascript function, To render the prepare the html by listmaker function, function have the 3 arguments Like:
function htmlrender (html, inputName, element )
html [HTML] -> prepare html by listmaker function
inputName [String] -> media field name
element [Object] instance of the media button which use to open the media popup.
$options [Array] => [
tag [string] -> should be html tag like: button, a, span, and more
tag_class [String] -> define the class name of media button
thumb [Array] => [
[
h [String] -> define the height of thumbnail
w [String] -> define the width of thumbnail
title [String] ->define the title of thumbnail
]
]
title [String] -> Title to diplay on the media popup
selected_btn_text [String] -> Selected button text
close_btn_text [String] -> Close button text
maxFiles [integer] -> Max number of file.
maxFilesize [integer] -> Max size of file in bytes
acceptedFiles [String] -> Accepted file type like: image/*,/png, application/*, .gif
]
All versions of laravel-media with dependencies
PHP Build Version
Package Version
The package hitesh399/laravel-media contains the following files
Loading the files please wait ....