• 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

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

MySQL order by field in Eloquent

PHPUNIT Test - Expected Status 200 But Received 500

carbon generated datetime not stored correctly into the database

Get sum of arrays inside array

php 7 php.ini upload_max_filesize not working

PHP array sort and remove duplicates by two field values

How to make a foreign key not using primary key

Creating command to backup MySql database in Laravel

laravel 5.6 bulk inserting json data

How to KeyBy where multiple items have the same key

Override default Auth routes in Laravel 7

Split array into 4-element chunks then implode into strings

How to convert time from one timezone to another in PHP

Laravel Schedule not sending email

About Contact Privacy policy Terms and conditions