Download the PHP package sirmekus/elu without Composer

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

Elu

Elu is a Laravel-powered file uploader that leaverages on the existing strength of Laravel's strong validation to add power to an exisitng web app. One of the additional benefits include enforcing (or constraining) image dimension. For instance, imagine your application expects image dimension to be 300/300px (height/width) and a user uploads an image with a dimension of 500/200px. Strictly constraining the dimension (using traditional approach) may result in low quality and a not-too-nice image. This library takes care of this effectively without sacrificing quality of the uploaded image.

Please note that this package is not limited to image upload; It takes care of any type of file upload in general - pdf, doc, audio, video, image, etc.

Installation

To get started all you need to do is:

Once installed you may publish the package's elu config file which you can then customise to your taste by running:

Please note that this package stores uploaded files/images in the storage folder and expects that symbolic link must have already been created. If you haven't, no problem. Simply run:

That's all.

Elu, in Igbo language, means "Up"; I bet you know how the name relates to this package now...#winks.


Usage


Receiving/Accepting file/image from client

Example:

Just that single line of code is what is needed to use this package. The package assumes the name (parameter) of the incoming file from the client is image. If it isn't then you can specify the name as the first argument. Example:

It doesn't matter if the file is an array or a single file, the package takes care of that, stores the uploaded file in disk and returns the new file name. If an array was detected the returned value will be an array containing the uploaded file names else a string that contains the file which you will want to save in the database.

You can set the configuration during runtime (if you choose to not use the configuration settings at any point in time) or overwrite the public properties of the class. The properties are:

By default the upload() method checks if the specified key exists in the incoming request and is filled. If it is not it throws an error. In certain cases image upload may be optional, thus the application should still continue with the request processing. To enable this the method takes a second argument that suppresses the error. Example

or, if you use use PHP 8.0 and above and the parameter name from the request is image.

Displaying the image

Because the file is stored in the storage directory and a symbolic link has already been created you can simply do (in your blade file):

Or, if the image is saved in a sub-directory (in storage/public/):

Deleting Image/File

To delete an image it follows the same logic and configuration as if uploading the image/file. Simply pass the image/file name(s) - string or array - to the remove() method and the job is done. Example:

Meanwhile

You can connect with me on LinkedIn for insightful tips and so we can grow our networks together.

Patronise us on Webloit.

And follow me on Twitter.

I encourage contribution even if it's in the documentation. Thank you, and I really hope you find this package helpful.


All versions of elu with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
intervention/image Version ^2.7|^3.0@alpha
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 sirmekus/elu contains the following files

Loading the files please wait ....