• 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

Having issue with matching rows in the database using PDO

Upgrade PHP on AWS Linux

Prestashop cUrl Login

Passing a boolean value from checkbox in Laravel form

Refresh specific HTML content that retrieves data from MySQL

WordPress - Dynamically add user ID to the end of a URL

Can I write PHP code across multiple lines per statement?

Show date difference as "20" instead of "20 years ago"

Symfony 4: "Autowire: you should configure its value explicitly."

ldap is missing from system when installing adldap2 in laravel

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

php - add comma thousands separator but remove trailing zeros

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

hidden INPUT value not available in $_POST

About Contact Privacy policy Terms and conditions