PHP Classes

Laravel PUT Helper: Process HTTP PUT requests to get files and values

Recommend this page to a friend!

  Author Author  
Name: Zacchaeus Bolaji <contact>
Classes: 13 packages by
Country: Nigeria Nigeria
Innovation award
Innovation award
Nominee: 7x


  Detailed description   Download Download .zip .tar.gz  
This package can process HTTP PUT requests to get files and values.

It comes with a Laravel service provider that can process HTTP PUT requests.

The package can set the PHP $_POST and $_FILES super-global variables with the values of the request parameters and uploaded file data submitted via the HTTP PUT method.

Details

Laravel PUT Helper

CircleCI Latest Stable Version Total Downloads License Build Status Scrutinizer Code Quality Code Coverage

Laravel PUT helper is a package that helps you get input data, as well as uploaded files for PUT requests

Installation

You can install the package via composer:

composer require djunehor/laravel-put-helper

Laravel 5.5 and above

The package will automatically register itself, so you can start using it immediately.

Laravel 5.4 and older

In Laravel version 5.4 and older, you have to add the service provider in config/app.php file manually:

'providers' => [
    // ...
    Djunehor\PutHelper\PutHelperServiceProvider::class,
];

Lumen

After installing the package, you will have to register it in bootstrap/app.php file manually:

// Register Service Providers
    // ...
    $app->register(Djunehor\PutHelper\PutHelperServiceProvider::class);
];

Usage

After following the above installation instructions, no further action is required. Input data (string and files) will be available for all your PUT requests

In order to validate if a param is file, use put_file in your validation. For example:

$request->validate([
'my_file' => 'required|put_file'
]);

How it Works

The package registers a global middleware that intercepts all PUT request and tries to get the input payload via php raw input stream. It then merges the parsed input data to the request object so the inputs are available normally from wherever you're accessing the request object. That is, if a file with field my_file is sent from the form, you can access via $request->file.

At the moment, $request->file('file_key') doesn't work. Use other methods instead e.g $request->file_key,$request['file_key].

Contributing

  • Fork this project
  • Clone to your repo
  • Make your changes and run tests composer test
  • Push and create Pull request

  Classes of Zacchaeus Bolaji  >  Laravel PUT Helper  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  

 

Name: Laravel PUT Helper
Base name: laravel-put-helper
Description: Process HTTP PUT requests to get files and values
Version: -
PHP version: 5
License: The PHP License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image HTTP HTTP protocol clients, headers and cookies View top rated classes
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder image.circleci (1 file)
Files folder imagesrc (2 files)
Files folder imagetests (2 files)
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  .circleci  
File Role Description
  Accessible without login Plain text file config.yml Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
  Plain text file PutHelperServiceProvider.php Class Class source
  Plain text file PutRequestMiddleware.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file PutRequestTest.php Class Class source
  Plain text file TestCase.php Class Class source

Download Download all files: laravel-put-helper.tar.gz laravel-put-helper.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.

For more information send a message to info at phpclasses dot org.