Last active
August 7, 2020 08:30
-
-
Save kamerk22/a3ecda8706e775212987a2b952b7adf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Requests; | |
use Illuminate\Contracts\Validation\Validator; | |
use Illuminate\Foundation\Http\FormRequest; | |
use Illuminate\Http\Exceptions\HttpResponseException; | |
use Illuminate\Http\JsonResponse; | |
use Waavi\Sanitizer\Laravel\SanitizesInput; | |
abstract class BaseFormRequest extends FormRequest | |
{ | |
use SanitizesInput; | |
/** | |
* For more sanitizer rule check https://github.com/Waavi/Sanitizer | |
*/ | |
public function validateResolved() | |
{ | |
{ | |
$this->sanitize(); | |
parent::validateResolved(); | |
} | |
} | |
/** | |
* Get the validation rules that apply to the request. | |
* | |
* @return array | |
*/ | |
abstract public function rules(); | |
/** | |
* Determine if the user is authorized to make this request. | |
* | |
* @return bool | |
*/ | |
abstract public function authorize(); | |
} |
where does 'ApiResponse' come from?
@nleco
ApiResponse is my own trait to format API resonse according to my requirements. You can skip this. Remove this trait from your implementation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is ApiResponse on here? If I use this code it doesn't work and there is no indication of where ApiResponse is supposed to be imported from!