PHP code example of finalgamer / laravel-method-form-request
1. Go to this page and download the library: Download finalgamer/laravel-method-form-request 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/ */
finalgamer / laravel-method-form-request example snippets
namespace App\Http\Requests;
use LaravelMethodFormRequest\FormRequest;
class UserRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function createRules(): array
{
return [
'name' => ' 'email' => 'email',
'password' => 'string',
];
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function deleteRules(): array
{
// Also supports DELETE requests. Altough this is used very rarely.
return [];
}
}