Download the PHP package robotkudos/rk-image-api without Composer

On this page you can find all versions of the php package robotkudos/rk-image-api. 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 rk-image-api

RKImageAPI

RK Image API handles the backend for rk-image-uploader. It receives api requests from rk-image-uploader and response securely.

Install

composer require robotkudos/rk-image-api

Usage

By default, RKImageAPI respond to /api/image-api with auth:api middleware. It will create a table named images and will be ready as soon as it's been installed. All you need to do it run following command to create the images table:

php artisan migrate

Config

If you need extra security (by adding more middlewares) or different api endpoint as well as changing the table name, you can publish vendor config file with the following command:

php artisan vendor:publish --provider='RobotKudos/RKImageAPI/RKImageAPIServiceProvider'

This will copy config file into config/rkimageapi.php. You can change the default values there.

APIs

POST /api/image-api

Receives the following

- image (FormData Image)
- key (random stringto group images, e.g. by user, or listing, ...)
- name
- position (the position for sorting purpose)
- comment (optional)

Response sample

{
    err: false, 
    id: 123
}

GET /api/image/api

Receives the following:

- key

Response sample

[
    {
        id: 123,
        name: sample_name,
        image_url: /img/sample_name.jpg,
        image_2x_url: /img/sample_name_2x.jpg,
        thumb_url: /img/sample_name_thumb.jpg,
        thumb_2x_url: /img/sample_name_thumb_2x.jpg,
        position: 1,
        comments: ...
     }
]

DELETE /api/image-api

It deletes all images with the key.

Receives the following:

- key

Response sample

{
    err: false
}

PUT /api/image-api/{id}

Edit the name of image.

Receives the following:

- action: rename // currenty only support rename
- name: the new name

Response sample

{
    err: false,
    name: new name
}

PUT /api/image-api/reorder

Swap the position of two images.

Receives

- id1
- pos1
- id2
- pos2

Response sample

{
    err: false
}

DELETE /api/image-api/{id}

Deletes the image

Receives no content

Response sample:

{
    err: false
}

Dig deeper

RKImageAPI needs to receive a key to group images. It creates four images for each image it receives. One normal size (by default 1500px, you can change it via config file), one double that size as Retina version, one thumb size (by default 180px, configurable via config file) and one double the thumb size for retina.

Under the hood, it uses RKImage package for resizing and saving the image.


All versions of rk-image-api with dependencies

PHP Build Version
Package Version
Requires robotkudos/rkimage Version ^0.1.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 robotkudos/rk-image-api contains the following files

Loading the files please wait ....