What do you want to save?
Add Code snippet
New code examples
-
PHP 2022-02-11 00:45:26
laravel if file is image
$allowedMimeTypes = ['image/jpeg','image/gif','image/png']; $contentType = $request->file->getClientMimeType(); if(! in_array($contentType, $allowedMimeTypes) ){ return response()->json('error: Not an image'); }else{ return $this->product... Add solution -
PHP 2021-11-17 02:38:15
laravel api form request validation 404
Set an "Accept": "application/json" Request Header -- OR -- force the default response behavior by sepcifying the response() method in your own CustomFormRequest class: // -- example -- // public function response(array $errors) { ... Add solution