Download the PHP package devhammed/byteship-php without Composer
On this page you can find all versions of the php package devhammed/byteship-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devhammed/byteship-php
More information about devhammed/byteship-php
Files in devhammed/byteship-php
Package byteship-php
Short Description PHP client for the Byteship Upload API.
License MIT
Homepage https://github.com/devhammed/byteship-php
Informations about the package byteship-php
Byteship PHP
Table of Contents
- Introduction
- Installation
- Usage
- Create a Client
- Server client
- Upload client
- Upload a File
- Multiple Files
- File Methods
- Manual Flow
- Errors
- Laravel
- Create a Client
- Testing
- Changelog
- Credits
- License
Introduction
PHP client & Laravel storage adapter for Byteship.
Installation
You can install the package via composer:
Usage
The first thing you need to do is to get an API key at Byteship. You'll find more info at the Byteship Docs.
Create a Client
Create the client with a full project API key only on trusted server code. Browser code should use a short-lived upload token minted by your backend.
Server client
Upload client
Keep API keys server-side!
Never ship a
bship_...project API key to the browser. UsecreateUploadTokenon your server and pass the returnedbsut_...token to frontend code.
Upload a File
Use upload when you want the SDK to create the upload session, send the bytes to storage, complete the upload, and
return the ready file.
Multiple Files
Use uploadMany for batches. Each result keeps the original file, a status, and either the uploaded file or a
Byteship\Error.
File Methods
Server clients can read file metadata, create temporary URLs for private files, download file, and delete stored files when the credential has the required scope.
Manual Flow
Use the lower-level methods when you need to own one part of the flow, such as sending the file bytes with a custom upload client.
Errors
Every SDK API request throws Byteship\Error for non-2xx responses.
Laravel
This package ships with a service provider for Laravel that will automatically setup the client for your application.
To get started, create an environment variable named BYTESHIP_API_KEY in your .env file with your Byteship API key:
Then, open config/filesystems.php and add the byteship disk configuration:
You should now be able to use the Byteship disk in your Laravel application just like any other storage drivers:
RECOMMENDED: You should set the default disk to
byteshipinsideconfig/filesystems.phpso you won't have to specify the disk name everytime you work with Storage.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Hammed Oyedele
- Byteship
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of byteship-php with dependencies
graham-campbell/guzzle-factory Version ^4.0.2|^5.0|^6.0|^7.0
guzzlehttp/guzzle Version ^6.2|^7.0
illuminate/contracts Version ^11.0||^12.0||^13.0
league/flysystem Version ^3.25.1
spatie/laravel-package-tools Version ^1.16