# Validate an image upload in Laravel and Vue

> The image rule checks the upload. Send it as POST with a file field, including when you are updating.

- URL: https://laravel-vuejs.space/laravel-image-rule-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, Inertia

People searching “Laravel image validation Vue” attach a file and get “the cover field is required” or a 500. The usual cause is a PUT request. PHP does not parse files on PUT. The [file upload guide](https://laravel-vuejs.space/laravel-vue-file-upload) shows the form. This page is the rule.

> **TL;DR**
>
> -   The image rule checks the upload.
> -   Send it as POST with a file field, including when you are updating.
> -   Do not point `axios.put` at the same URL with a `FormData` body and expect the file to arrive.
> -   Do not run `storage:link` on Laravel Cloud.
>
> **Who it's for:** Laravel + Vue developers on Inertia
>
> **Applies to:** Laravel 13 · Inertia 3 · Vue 3

## The fix

```php
$validated = $request->validate([
    'cover' => ['required', 'image', 'max:2048'],
]);

$path = $validated['cover']->store('covers', 'public');
```

`image` allows the types Laravel treats as images. `max:2048` is kilobytes, so this is 2 MB. A Vue `accept="image/*"` is a hint to the file picker. It is not the check.

```vue
<Form action="/posts" method="post" v-slot="{ errors, processing }">
  <input type="file" name="cover" />
  <p v-if="errors.cover">{{ errors.cover }}</p>
  <button type="submit" :disabled="processing">Upload</button>
</Form>
```

To replace a cover on an existing post, keep `method="post"` and send `_method` as `put`. The Form component does that when the Wayfinder action is an update. Do not point `axios.put` at the same URL with a `FormData` body and expect the file to arrive.

## What to avoid

> **Gotcha**
>
> Do not run `storage:link` on Laravel Cloud. The [deploy guide](https://laravel-vuejs.space/deploy-laravel-vue) says the symlink does not survive there.

## FAQ

**Q: How do I validate an image upload in Laravel and Vue?**

The image rule checks the upload. Send it as POST with a file field, including when you are updating.

**Q: What goes wrong with Laravel image validation Vue?**

Many developers attach a file and get "the cover field is required" or a 500. Do not point `axios.put` at the same URL with a `FormData` body and expect the file to arrive.
