• 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

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

PHP block shortcut in Visual Studio Code

Get WooCommerce products from specific category

How to redirect to another page and call a Function there on Angular ng-click

"Unable to load dynamic library 'pdo_sqlsrv.so' "Cenos7 PHP7.2.10

WordPress ACFNotice: get_field() - We've detected one or more calls to retrieve ACF field values before ACF has been initialized

PHP if in_array() how to get the key as well?

virtctl works when executed via command line but not from php exec()

SQL AVG() to 2 decimals

How to set a domain name with php artisan serve

How to create a video stream from a single dynamic image in PHP

How can I format this number correctly using PHP?

How to send upload image through email

Unable to create lockable file - Laravel 8 & PHP 8

In PHP, which is faster: preg_split or explode?

About Contact Privacy policy Terms and conditions