Answers for "laravel image exist check"

1

image exists in laravel

if(File::exists(public_path('images/1461177230.jpg'))){    dd('File is exists.');}else{    dd('File is not exists.');}
Posted by: Guest on May-08-2021
0

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->productService->storeImage($request->file);
}
Posted by: Guest on June-10-2021

Code answers related to "laravel image exist check"

Browse Popular Code Answers by Language