Download the PHP package tranghaviet/imgur-laravel without Composer

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

Description

A Laravel (>= 5.8) Package for using the Imgur api. Internally we use j0k3r/php-imgur-api-client. The package provides a service provider, some configuration and a facade, such that you should be able to get started with writing your app immediately.

For more detailed documentation on how to use j0k3r/php-imgur-api-client you should look at their documentation.

Quick example

Getting started

First you will have to install the package using composer

Imgur uses Oauth 2.0 to authenticate users. Therefore you have get a authentication token from your users if you want them to be able to view and upload images. In Laravel you can do this by first add a route middleware to the Redeman\Imgur\Middleware\AuthenticateImgur middleware in your App\Http\Kernel.

Next you should add the imgur middleware to any route were a user should be authenticated by Imgur. The AuthenticateImgur middleware will store and retrieve the user's access token. If the user is not authenticated by the Imgur (meaning your application doesn't know the user's access token), then the user will be redirected to a route with the name imgur.authenticate. If you are a Laravel 4 user, then you only need to add the service provider. This provider will register a imgur filter which you can use for your routes, see the example below how to do this. In the following section we show an example of some simple routes.

Example

routes.php:

imgur.images.blade.php:

imgur.authenticate.blade.php:

Now you're all set! The next section describes how you can configure the package to use your client id, secret and a custom TokenStorage.

Configuration

You can publish the configuration file:

Now you can fill in the appropriate values for client_id and client_secret. It is encouraged to use a .env which contains your client id and secret.

Using a custom TokenStorage

The AuthenticateImgur middleware uses a Redeman\Imgur\TokenStorage\Storage interface to store a user's access token. By default we provide a SessionStorage which will save the data in the user's session. However you could also use a database or some other storage facility. To do this you will have to change the token_storage value in your config/imgur.php file to the name of the class that you want to use.

Todos:


All versions of imgur-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^7|^8
laravel/framework Version ^5.8|^6|^7|^8
j0k3r/php-imgur-api-client Version ^3.0.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 tranghaviet/imgur-laravel contains the following files

Loading the files please wait ....