Q:

Uploading image over 2M in Laravel has no path

When I upload an image that is over 2MB to my Laravel application, it comes in as application/octet-stream mime type instead of image/jpeg, and it also has no temp path. My controller looks like this:
public function upload(Request $request)
{
    if ($request->isMethod('post')) {
        $file = $request->file('entry_photo');
        ...
    }
}

If I run dd($file);, it shows that the path is just my public directory and the mime is application/octet-stream. This only happens on images over 2M. My php_ini has upload_max_filesize set to 10M, and post_max_size to 8M. I'm sure this is a server thing, but can't seem to figure out where.

A:

Firstly, I would suggest outputting phpinfo() on a temporary page to figure out whether the changes you have made to you php.ini have taken effect. I've fallen into the trap of not restarting fpm before and therfore the changes not applying.
Secondly, if you are using nginx make sure you have the following in your nginx config
client_max_body_size 100m;

More info on nginx settings for file uploads can be found here:
https://www.nginx.com/resources/wiki/modules/upload/

