Plank\Mediable\Exceptions\MediaUpload\FileNotSupportedException::mimeRestricted PHP Method

mimeRestricted() public static method

public static mimeRestricted ( $mime, $allowed_mimes )
    public static function mimeRestricted($mime, $allowed_mimes)
    {
        $allowed = implode('`, `', $allowed_mimes);
        return new static("Cannot upload file with MIME type `{$mime}`. Only the `{$allowed}` MIME type(s) are permitted.");
    }

Usage Example

 public function test_it_returns_a_415_for_restricted_type()
 {
     $e = (new SampleExceptionHandler())->render(FileNotSupportedException::mimeRestricted('text/foo', ['text/bar']));
     $this->assertHttpException($e, 415);
 }
All Usage Examples Of Plank\Mediable\Exceptions\MediaUpload\FileNotSupportedException::mimeRestricted