Download the PHP package andreinocenti/laravel-file-s3-like without Composer

On this page you can find all versions of the php package andreinocenti/laravel-file-s3-like. 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-file-s3-like

Laravel Package - Files to S3 Like Cloud Storage

This is a Laravel package that handles and make easy the upload, overwrite, delete, cdn purge of files and directories on AWS S3 like cloud storages.

It supports a form uploaded file (UploadedFile) or a base64 file string

Support

At the actual version it support only Digital Ocean SPACES cloud storage.

In the future I will add new cloud storages support or accept pull requests.

Configuration

You should install it via composer:

composer require andreinocenti/laravel-file-s3-like

This package use the Laravel Illuminate\Support\Facades\Storage facade to handle the files.

So you must config the filesystem AWS like disk that you want to use.

Below the optimal config to be used

config/filesystem.php

Usage

You can use the FileS3LikeSpaces facade

Or you can use the FileS3Like Facade, if you do you must set the repository() you want to use.

Methods / Accessors

FileS3Like and its repositories (Eg: FileS3LikeSpaces)

Method Description
repository(string $repository): self The repository is the s3 like service that this package support, that you want to use. Eg.: spaces. Check the Support list
disk(string $disk): self Sets the filesystem disk that the Storage facade will use to handle the files on the cloud storage
directory(string $directory): self The directory in the cloud storage bucket that will be handled. Important: It will concat with the folder configurated in the file filesystem. The folder configuration, is good to have always the same base directory configured, instead of the "directory()" that can change anytime EG.: if folder was configured to be "public", and the directory "images", the final path will be `public/images`.
upload(UploadedFile|string $file, ?string $filename = null): DiskFile Upload the file to the storage. If $filename is empty, the name of the file will be aUUID hash.
save(string $repository): DiskFile Upload and update the file on the space disk, purge cache and return the file url. If a file with the same name already exists, it will be overwritten and the cache will be purged. If it is a new file, it will only be uploaded. If $filename is empty, the name of the file will be aUUID hash.
purge(string $filepath): self Purges a CDN cache of a file. $filename - Inform the file name and path of the file to be purged.
delete(string $filepath): self Delete a file from the cloud storage disk
deleteDirectory(string $filepath): self Recursively delete a directory from the cloud storage disk
directories(string $filepath): array List directories in the directory set
files(string $filepath): array List files in the directory set

DiskFile

DiskFile is a DTO class that is created and delivered when the functions upload or save are called. The class contain accessors that returns some file data.

Method Description
getFilepath(): string Return the file, filepath without the url. Eg: "some/path/to/file.jpg".
getFilename(): string Return the file name. Eg: "file.jpg".
getUrl(): string Returns the full file url. Eg: "https://somedomain.com/some/path/to/file.jpg".
getExtension(): string Returns the file extension. Eg: "jpg".

All versions of laravel-file-s3-like with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
xantios/mimey Version ^2.2
illuminate/contracts Version ^8.0|^9.0|^10.0|^11.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
league/flysystem-aws-s3-v3 Version ^1.0|^2.0|^3.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 andreinocenti/laravel-file-s3-like contains the following files

Loading the files please wait ....