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

Recommend this page to a friend!
  Info   Documentation   View files (11)   Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-04-28 (3 months ago) Not yet rated by the usersTotal: 37 All time: 9,910 This week: 307
Version License PHP version Categories
laravel-put-helper 1.0The PHP License5HTTP, PHP 5
Description Author

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.

Innovation Award
PHP Programming Innovation award nominee
April 2020
Number 8
The HTTP PUT method can be used in alternative to POST method to submit forms parameter values and upload files.

This package provides a solution to parse requests submitted with the HTTP PUT method.

It extracts the values of the parameters and data from uploaded files in a way that applications can process the submitted data like when the HTTP POST method is used.

Manuel Lemos
Picture of Zacchaeus Bolaji
  Performance   Level  
Name: Zacchaeus Bolaji <contact>
Classes: 13 packages by
Country: Nigeria Nigeria
Age: ???
All time rank: 302016 in Nigeria Nigeria
Week rank: 246 8 in Nigeria Nigeria
Innovation award
Innovation award
Nominee: 8x

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
  Files  
File Role Description
.circleci (1 file)
src (2 files)
tests (2 files)
.scrutinizer.yml Data Auxiliary data
.styleci.yml Data Auxiliary data
composer.json Data Auxiliary data
LICENSE Lic. License text
phpunit.xml Data Auxiliary data
README.md Doc. Documentation

  Files  /  .circleci  
File Role Description
   config.yml Data Auxiliary data

  Files  /  src  
File Role Description
   PutHelperServiceProvider.php Class Class source
   PutRequestMiddleware.php Class Class source

  Files  /  tests  
File Role Description
   PutRequestTest.php Class Class source
   TestCase.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:37
This week:0
All time:9,910
This week:307

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