• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Unable to guess the mime type as no guessers are available Laravel 5.2

phplaravel


PHP Snippet 1:

<?php

namespace App\Support\Enum;

enum ImageExtension: string {
    case Png = 'png';
    case Jpg = 'jpg';
    case Jpeg = 'jpeg';

    /**
     * Return all values as array
     *
     * @return array
     */
    public static function values()
    {
        return array_map(
            fn(ImageExtension $imageExtension) => $imageExtension->value,
            self::cases()
        );
    }
}

PHP Snippet 2:

['image', 'mimes:' . implode(',', ImageExtension::values()), 'max:10000'],

Related Snippets

How can I make Laravel return a custom error for a JSON REST API

auth pages not getting css in laravel

Failing validation doesn't stop code execution in livewire component

(Laravel) How to delete multiple models including optional relationships?

How to create a individual template for page or post in custom plugin?

Prevent blank space in pdf pages (DomPdf)

Boolean assignment operators in PHP

Best way to scrolldown onpageload

Select option from dropdown menu with PHP and mySql

Laravel Passport - Not able to get token string in response?

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

I cannot create a auto generated date time in mysql workbench

How to render html from a @foreach loop in a textarea

api response laravel doesn't show

Add custom text under order details on WooCommerce My account view order pages

About Contact Privacy policy Terms and conditions