PHP code example of olegstan / laravel-rest
1. Go to this page and download the library: Download olegstan/laravel-rest library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
olegstan / laravel-rest example snippets
class ClientController extends BaseController
{
public function postStore(Request $request)
{
$userId = $request->input('user_id');
$firstName = $request->input('first_name');
$lastName = $request->input('last_name');
// Implement your logic here
return $this->response()->success();
}
}
bash
php artisan vendor:publish --provider="LaravelRest\LaravelRestServiceProvider"