Beispiel #1
0
 /**
  * Validate the MIME type of a file upload attribute is in a set of MIME types.
  *
  * @param  string  $attribute
  * @param  array   $value
  * @param  array   $parameters
  * @return bool
  */
 protected function validate_mimes($attribute, $value, $parameters)
 {
     if (!is_array($value) or array_get($value, 'tmp_name', '') == '') {
         return true;
     }
     foreach ($parameters as $extension) {
         if (File::is($extension, $value['tmp_name'])) {
             return true;
         }
     }
     return false;
 }