Download the PHP package sergmoro1/laravel-imageable without Composer

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

Laravel Imageable

The Imageable package allows quickly and easily to enable image uploading for any model. Uploading files, processing them, and saving them to the desired storage is taken over by Imageable. Besides each image may have some descriptive fields associated with it.

API

The Imageable package uses the API to download, process and save files. Therefore, authentication is required for the package to work. By default, basic stateless authentication is used to pass tests and make to a quick start.

Changes

Tailwindcss is used in Imageable by default, as in the Laravel. Since css, js, views resources are published after installing the package, it is possible to change templates and customize interface elements.

Limitation of use

Only one component <x-imageable-upload /> can be placed on the page.

Installation

Run migration

Publish resources

Usage

For ability images uploading add HasStorage, HasImages traits to the model.

Insert upload component in a view.

Please note that the component uses an instance of the model, therefore, it must be available in the template.

The limit parameter defines the number of images that can be uploaded for the model. The default is 0, which means you can upload any number of images.

If the necessary css and js files are already connected to the page, and this is possible if you have already connected Imageable for another model, then you can upload images.

JS libs & plugins

Add in dependencies section of the package.json file two lines

Then run in the console

CSS

In a file resources/css/app.css, after lines

add line

If necessary, you can make adjustments to the classes definition in the resources/css/imageable/upload.css file since this is a copy of a similar package file.

JS

To upload images and work with additional fields related to images, add two lines to app.js.

If you want to upload more than one file for a specific model, you can add a plugin for sorting of images Sortable. This is important when you want to change the order of image output in frontend or want to use the first image as the main image. Sorting is performed by drag & drop the mouse. Add a line below for images sorting to app.js.

CSS placement

The Imageable package uses Google Material Icons, so you need to connect the icons to the page. For example in views/layouts/app.blade.php.

JS placement

Since the Imageable package uses the API to upload files, authentication is required. By default, the package uses basic stateless authentication to run tests and quickly start using the package. Place the app_credentials variable on the page. The variant of receiving credentials is yours.

Finally

Run in the project directory

Configuration

The storage parameters, the view of line associated with the uploaded file, the number and values of additional parameters can be changed.

Model

By default, the parameters for storing images are set

An empty path parameter means that a subdirectory with the model name will be created on the selected disk. For example, storage/app/public/post. The separately parameter set to true means that a separate directory will be created for each model with the Id of the model as the name. For example, storage/app/public/post/1. Storage parameters can be changed according to the principles of Laravel file storage using the setStorage method of the Sergmoro1\Imageable\Traits\HasStorage class.

Only the caption field is set as an additional field for each image. The list of fields, their order and default values can also be redefined using the setAddonDefaults() method of the class Sergmoro1\Imageable\Traits\HasImages.

Both methods must be called in the constructor of the corresponding model. For example, defining fields:

Views

After installing and publishing the package, the component files are copied to the resources\views\vendor\imageable directory, where you can freely edit html markup, change styles and add/remove fields to describe each uploaded image.

Addon fields

To change the list of additional fields of uploaded images, you need to edit the default values in the addonDefaults variable of the model, as mentioned above, and the vendor\imageable\line\fields.blade.php view, where it is necessary to define additional html markup. An example with possible fields and their values is given in the package in the file fiealds-example.blade.php.

If the list of additional fields varies from model to model, then the contents of the files line\fields.blade.php should be different and therefore the file names should be different. The model variable $addonFieldsView is used to specify the file name. The name can be anything, for example:

You need to copy the file vendor\imageable\line\fields.blade.phpto the file vendor\imageable\line\post-fields.blade.php and make changes.

Tests


All versions of laravel-imageable with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0|^8.0.2|^8.1|^8.2
illuminate/support Version ^8.1|^9.0|^10.0|^11.0
imagine/imagine Version ~0.5.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 sergmoro1/laravel-imageable contains the following files

Loading the files please wait ....