• 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

Laravel Excel::store file empty after stored

How can I access an array/object?

Laravel implode array items to new lines

500 (Internal Server Error) with Laravel & Docker [duplicate]

set mail driver dynamically from database for different email in notification

Yii2: How to download backup files using spanjeta/yii2-backup?

Show Custom Data in Woocommerce Order Details Admin Area

Form repeater send wrong data with last element in Laravel

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

How to edit Records using CodeIgniter

Handling expired token in Laravel

woocommerce get_order_report_data to show order_item_id

How to get array values using foreach in laravel

Adding the custom page with add_menu_page function on Wordpress

Apply filter array/return terms

About Contact Privacy policy Terms and conditions