Download the PHP package yektadg/medialibrary without Composer

On this page you can find all versions of the php package yektadg/medialibrary. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package medialibrary

laravel-media-library

MediaLibrary is a laravel library for handling images in laravel projects . You can upload your images , modify their alt , categorize them into the folders and etc. It also compress your images to 4 different sizes and keeps the original size , so you can access them in client side based on user screen or use it with lazy loading .

Packagist Version License: GPL v3

Screenshots

laravel-media-library

Installation

You can install the package via composer:

Once installed, you should publish the provided assets to create the necessary migration and config files.

Requirements

BootStrap 5

jQuery

Axios Js

Usage

Just add the following line at the end of your laravel blade after all javascript codes .

If you want to just access the media library view for using alongside your customized view you can use the following line .

If you want to use both on the same page beware of id conflict between them .

Then you must add class to your html button to open the library .

You can use MediaLibrary for different use types ( you can view all usage under this section ) , so you should specify it when defining button .

Sample of defining MediaLibrary for usage :

In above code after clicking on Upload Images MediaLibrary pops up and after selecting images , they will be stored in the hidden input with html id image-holder-1 .

The three first attributes are MediaLibrary attributes .you can see all of MediaLibrary attributes in the below section .

Attributes

MediaLibrary uses different html attributes on html elements (like buttons,anchor and ...) to handle different situation .

You can see list of attributes below :

Attribute Description
useType Defines the type of element for usage (for now 3 types are supported : hidden , imagePreview , tinymce)
multipleSelect Allows MediaLibrary to select multiple images for use (like when you use tinymce)
useId Refers the html element that holds the images

Note : All attributes and their values are case-sensitive

Features

Limiting Access To Medias

You can limit access to medias by adding accessAllMedia attribute to the Request using laravel middleware.

Here is the example how to do it :

  1. First make a middleware with laravel command php artisan make:middleware CheckAccessMedia
  2. Register your middleware in kernel.php at $routeMiddleware array in Http folder of your project 'CheckMediaAccess' => CheckMediaAccess::class
  3. Then add the alias of your middleware in middleware array in medialibray.php at config folder of your project in this case 'CheckMediaAccess'
  4. Edit your newly created middleware and add your condition for example :

In above example user with id of 1 can access all of uploaded medias but all other users can only access their medias.

Lazy Loading

MediaLibrary generates images in 4 different size , you can use them for lazy loading . Below code loads images based on user screen size :

Note : you need to define imageExistRoute before above codes;

Then you can use lazy loading by adding resizing class and originalSrc attribute to your html image tag .

Note : default image should have low disk size and be a constant image for all pages

Language

You can edit toast.blade.php for changing toast header in resources/views/vendor/yektadg/medialibrary.

For changing toast messages edit mlLang.js in public/vendor/yektadg/medialibrary.


All versions of medialibrary with dependencies

PHP Build Version
Package Version
Requires intervention/image Version ^2.7
plank/laravel-mediable Version ^5.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yektadg/medialibrary contains the following files

Loading the files please wait ....