The image max rule is kilobytes

max:2048 on a file is 2 MB. PHP can reject the upload first, and Laravel then looks like the field was empty.

For your AI agent

Copies a prompt. Paste it into the AI agent you already have open.

Read https://laravel-vuejs.space/laravel-image-max-kilobytes-vue.md
max:2048 on a file is 2 MB. PHP can reject the upload first, and Laravel then looks like the field was empty.
Do not compare the size in Vue and skip the rule.
Do not write max:2 and add a comment that says "2 MB".
Show the diff. Do not commit.
On this page · 3 sections
  1. The fix
  2. What to avoid
  3. FAQ

People searching “Laravel image max size” set max:2 and then a normal photo fails. On a file, max is kilobytes. 2048 is 2 MB. The upload guide is the form. This page is the number.

TL;DR

  • max:2048 on a file is 2 MB.
  • PHP can reject the upload first, and Laravel then looks like the field was empty.
  • Do not compare the size in Vue and skip the rule.
  • Do not write max:2 and add a comment that says “2 MB”.

Who it's for: Laravel + Vue developers

Applies to: Laravel 13 · Vue 3

The fix#

php
'cover' => ['nullable', 'image', 'max:2048'],

If php.ini upload_max_filesize is smaller, PHP drops the file before Laravel. The field arrives empty. The error looks like required failed, or the nullable field is quietly missing. Raise upload_max_filesize and post_max_size together, above the Laravel rule, so the rule is the one the user sees.

The Vue input can set accept="image/*". That does not enforce the size. Print form.errors.cover.

What to avoid#

Gotcha

Do not compare the size in Vue and skip the rule. A person can POST a larger body without your component. Do not write max:2 and add a comment that says “2 MB”. The next reader will believe the comment.

FAQ#

Is the Laravel image max rule in kilobytes?

max:2048 on a file is 2 MB. PHP can reject the upload first, and Laravel then looks like the field was empty.

What goes wrong with Laravel image max size?

Many developers set max:2 and then a normal photo fails. Do not compare the size in Vue and skip the rule.

Found this useful?

Ask questions, share what you built.

Join thousands of Laravel and Vue developers in our Facebook group, or get new posts in your Telegram feed. Sharing this article helps too.

Keep reading

Newsletter

Get the best of Laravel & Vue, once a month.

One short email with new guides, release notes worth reading and hand-picked community links. No spam, unsubscribe any time.