Download the PHP package laravel-admin/media-manager without Composer

On this page you can find all versions of the php package laravel-admin/media-manager. 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 media-manager

Laravel-Media-Manager

This package has 4 main goals:

Note: This package is still under development. Using it on productions environments is on your own risk. Collaborations and tips are always welcome

Requirements

This package is completely build on the philosofy of Laravel 5.3. It uses the 5.3 method to quickly upload files and a Vue components setup as in Laravel Elixir 6. Do not use this package for Laravel 5.2 or lower. The templates of the Vue components are completly build on Bootstrap 3.

Installation

Require this package with Composer

composer require laravel-admin/media-manager

Add the ServiceProvider to the providers array in app/config/app.php

LaravelAdmin\MediaManager\MediaManagerProvider::class

If you want to edit the config or backend views you need to publish these resources to your application

php artisan vendor:publish

The package generates a migration file for the media model, so migrate your database to create the table.

php artisan migrate

To use the Vue components in your (admin) applications, require the javascript bootstrap file from your vendor folder in your app.js file.

require('../../../vendor/laravel-admin/media-manager/resources/js/bootstrap.js');

Note: The javascript requires Dropzone to work, use the following statement to install it:

npm install dropzone --save-dev

Upload media

With the following code you can upload a file to your default storage and returns the created media model.

Note: the first parameter of the handle method is the default Laravel Request object. The second parameter is the name of the submitted file.

It's possible to upload a file to another storage. This storage has to be a configured storage as in config/filesystems.php

Note: The Eloquent model saves the storage in the database, so your application always knows where to find the uploaded file.

The Uploader uses a driver based system to add files to your storage and database. You can create your own drivers and add it to the media config, within upload/drivers. Your driver has to implement the following interface:

LaravelAdmin\Mediamanager\Contracts\UploadDriver

By default the package provides two drivers. The default for uploading files from your request and a second one 'url' to directly save files from an url. To change the driver, just do:

You can also replace an existing model instead of create a new one.

Create a relation

If you want to create a relation between your model and the media model, you can do this simple to add a field to your table and add the MediaTrait to your model.

Create a migration and add the following:

Note: add ->after('fieldname') to add the field at the position you want.

Now add the MediaTrait to your model

The trait is based on the convention that the field you add in your database is called 'media_id'. If you prefer another naming, or you have more than one field like a header, just add a relation manually to your model:

Now the trait is integrated, for now there are two new methods available on your model

mediaUrl

The mediaUrl method directly returns the public url of the connected media on your model

$blog->mediaUrl();

Note: As parameter it is possible to send a custom media field.

imagestyle

The imagestyle receives the imagestyle you want and return directly the url of the style. As second parameter you can pass a custom relation instead of 'media'.

$blog->imagestyle('thumbnail');

All versions of media-manager with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2
ext-gd Version *
guzzlehttp/guzzle Version ^7.8
intervention/image Version ^3.0
laravel/framework Version ^10.0|^11.0
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 laravel-admin/media-manager contains the following files

Loading the files please wait ....