PHP code example of sorokin-fm / laravel-request-sanitizer
1. Go to this page and download the library: Download sorokin-fm/laravel-request-sanitizer 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/ */
sorokin-fm / laravel-request-sanitizer example snippets
public function update(UpdateRequest $request, $id)
{
/** @var SomeModel $model */
$model = SomeModel::find($id);
$model->fill($request->input());
$model->save();
return back()
->with('success', __('Some model has been changed'));
}
public function update(UpdateRequest $request, $id)
{
/** @var SomeModel $model */
$model = SomeModel::find($id);
$model->fill($request->sanitize());
$model->save();
return back()
->with('success', __('Some model has been changed'));
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.