Download the PHP package escapework/laramedias without Composer

On this page you can find all versions of the php package escapework/laramedias. 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 laramedias

Laramedias

Latest Stable Version Downloads Travis - Build Status License MIT Scrutinizer Quality Score

A Laravel package that integrates [Glide](http://glide.thephpleague.com) and easy media management on your Laravel project.

Version Compatibility

Laravel Laramedias
9.0.x 0.9.x
5.5.x 5.6.x 5.7.x 0.7.x
5.4.x 0.6.x
5.4.x 0.5.x
5.3.x 0.4.x
5.2.x 0.3.x
5.1.x 0.2.x

Installation

Via Composer:

Configuration

And execute the following code:

Configurations explained:

Usage

This package allows you to easily use medias with your laravel models. There are two basic ways to use:

One model has multiple medias

Let's say you have a Product model that need to have multiple medias. You have to do this:

Now, you can do this:

Upload and create multiple medias:
Interate through your medias

The $product->medias will be a default Laravel collection of EscapeWork\LaraMedias\Models\Media models which you can use any of the collection methods available.

Each $media object will be a LaraMedias\Models\Media eloquent model, which will have a presenter for easily displaying images (see the above example).

The parameters in the example are the Glide width (w), height (h) and fit. You can see a simple example here (http://glide.thephpleague.com/1.0/simple-example/).

If your model was deleted, all the medias will be deleted too.

Deleting medias

For delete your medias, just call the method removeMedias.

For removing all medias, just call the removeMedias method without any parameters.

Events

These events are dispatched when in the above use case:

Action Event
EscapeWork\LaraMedias\Models\Media::created EscapeWork\LaraMedias\Events\MediaAdded
EscapeWork\LaraMedias\Models\Media::updated EscapeWork\LaraMedias\Events\MediaUpdated
EscapeWork\LaraMedias\Models\Media::deleted EscapeWork\LaraMedias\Events\MediaDeleted

One model has one media field

Let's say you have a Banner model and want to upload a single image for him. With Laramedias you can do this:

First, configure the config/medias.php file:

Second, use the EscapeWork\LaraMedias\Traits\Medias trait in your Banner model.

Then, you can just use the uploadSingleMedia method.

After that, you can just use the media helper method to show your banner.

I would also recomend in this case to make use of Presenters. You can use your custom setup or make use of this package that makes it very easy.

Then, you can setup like this:

And you like this:

Contributing

Feel free to open any pull request/issue with your idea/bug/suggestion.

License

See the License file.


All versions of laramedias with dependencies

PHP Build Version
Package Version
Requires escapework/laravel-steroids Version 0.7.*
league/glide Version ^2.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 escapework/laramedias contains the following files

Loading the files please wait ....