Open MatiasManevi opened 5 years ago
I have just test one thing and it work like a charm.. It appears to be possible, this is an updated code of my use of filters on FormRequest class
public function filters() { return [ 'name' => 'trim|strip_tags|escape|lowercase|hash', ]; }
public function customFilters() { return [ 'hash' => function($value, $options = []) { return sha1($value); }, ]; }
For testing purposes Ive implemented a hashing fitler function and this is the result:
{ "success": true, "data": { "name": "c205c127a6626be13e2e0d1c95adc9a7c0b6d6b2", "type": true, "perceive_vat_tax": false, "perceive_admin_profit": false, "perceive_interest": false, "account_id": 11, "user_id": 5, "updated_at": "2018-11-23 16:13:58", "created_at": "2018-11-23 16:13:58", "id": 399 }, "message": "Concept saved successfully" }
I hope it helps someone else;.
Hello. it is possible to do this?
This is my Request class:
`namespace App\Http\Requests\API;
use App\Models\Concept; use InfyOm\Generator\Request\APIRequest; use Waavi\Sanitizer\Laravel\SanitizesInput;
class CreateConceptAPIRequest extends APIRequest { use SanitizesInput;
}`