Download the PHP package classic-o/nova-media-library without Composer

On this page you can find all versions of the php package classic-o/nova-media-library. 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 nova-media-library

Laravel Nova Media Library

Tool and Field for Laravel Nova that will let you managing files and add them to the posts.

Table of Contents

Features

Migration from 0.x to 1.x

In version 1.x, the configuration file and database migration have been changed.
After upgrading to version 1.x, you need to remove the old table from the database, then reinstall and reconfigure these files.

Requirements

Install

Configuration

See configuration file

Usage

Add tool in app/Providers/NovaServiceProvider.php

Add Field to the resource.

Customization

By default, this field is used as single file. If you need to use as array of files, add option:

By default this files display automatically, gallery or list as in tool.
You can set in first parameter needed display type:

When you use array, set the casts as array to needed column in model and set type nullable TEXT in database
For single file - nullable INT

If you want to hide files under the accordion, add the following option:

You can limit the selection of files by type (Labels of types from configuration file).

To set preview size of images in fields, add the following option (Label of cropped additional image variation)
By default, the preview size is set in the configuration file.

You can also integrate the Media Field with the Trix editor. You need to set a unique name in the trix option and add an additional attribute with the same name in the Trix field:

For set a custom callback for the Media Field, use the method jsCallback.

Your JavaScript callback should have 2 parameters. The first will be an array of files, second - your options.

When you use JS Callback or Trix option two or more times on one resource, set second parameter of make method to any unique name

Upload by url or path

Also you can programmatically add files to the media library by url or path.

If upload done successfully, function return instance of model.
If an error occurred while loading, function will throw exception.

Exceptions (code => text):
0 - The file was not downloaded for unknown reasons
1 - Forbidden file format
2 - File size limit exceeded

Get files by ids

In your model stores only id of file(s). To get files, use the API class method:

Private files

When you use local storage or s3 (with private visibility), you can't get files by url.
To get file, you need to create a GET Route with the name nml-private-file with parameter id and optional img_size. In controller add validation user access.
If access is allowed, you can get file by API method:

Localization

To translate this tool another language, you need to add the translation file /resources/lang/vendor/nova-media-library/{lang}.json by adding phrases from en.json

Screenshots

Media Library

Media Library

Details

Crop Image

Index Field

Form Field

Record


All versions of nova-media-library with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
intervention/image Version ^2.
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 classic-o/nova-media-library contains the following files

Loading the files please wait ....