Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jpeterson579's avatar

Spark: profile image not found.

Did a fresh install of spark, everything seems to be working fine however when i tried to upload a profile image the page refreshed and the profile image is not being found. The link is pointing to

http://localhost:8888/storage/profiles/557d848b184ab1248109f7b94fe03d7d.jpeg

However I dont have a profiles folder in my public/storage/ directory.... Its empty, so where is this all going?

Did I miss somthing in setup?

0 likes
19 replies
samo's avatar

Did you forgot this part of the installation?

Spark documentation: Linking The Storage Directory

Once Spark is installed, you should link the public/storage directory to your storage/app/public directory. Otherwise, user profile photos stored on the local disk will not be available:

ln -s /path/to/storage/app/public /path/to/public/storage
1 like
Taytus's avatar

Same problem. I did the linking but the profile pic is still missing.

Mfrancik's avatar

Was this solved? I am having he same issue

AtlasApollo's avatar

I am also having the same issue, and yes, did run artisan storage:link on a brand new install of Spark 4.0.

AnthonyReid's avatar

Same here with fresh install of spark 4.0.4, Laravel 5.4.11, php7.1 and Valet

Tried linking with php artisan storage:link and also

ln -s $(pwd)/storage/app/public $(pwd)/public/storage

Also tried other variants of the above from the root of the project.

*edit - dropping a file manually into the /public/storage directory replicates it back to the /storage/app/public directory as expected. So Im thinking this might be a spark bug?

Cronix's avatar

is your app actually running on the "localhost" domain? It stores the domain as part of the image path in the db so unless you set APP_URL correctly in your .env it will use the default of "http://localhost" which may not be correct.

1 like
Cronix's avatar

Also, when doing the linking, if you are in a VM like homestead you need to run the artisan command or manual linking from within the VM, not your local filesystem.

ejdelmonico's avatar

Folks, you would be best served by thoroughly reading the laravel docs on storage. If your permissions are correct and your APP_URL is correct, then you should have to do nothing more than run php artisan storage:link without any special variants. Once these items are posted, they are stored locally in a very Laravel specific manner and have to be accessed in a Laravel specific manner...all of this is explained in the docs. Do yourself a favor and read the Laravel docs. Personally, I have not encountered any problems using storage and it should work perfectly for you as well. And, that includes using it in Spark.

https://laravel.com/docs/5.4/filesystem

1 like
Cronix's avatar

@Daaf Yes Said is fixing it. That commit you linked to which was trying to delete the previously uploaded image (because they weren't by default) accidentally deleted the newly uploaded image instead. So it's deleting the image as soon as it gets saved to disk.

https://github.com/laravel/spark/issues/593

1 like
AnthonyReid's avatar

Thanks Daaf,Cronix for confirming the bug.

Thought I was going crazy.

I implemented the changes in Said's commit above , and it fixes the problem.

futuremandigital's avatar

LOL lost 3 hours today on this as it was working a few days ago before I upgraded to Spark 4.0

HamsiKafalu's avatar

LoL you have to set your APP_URL in your env file then refresh your app and reupload your photo

1 like
AtlasApollo's avatar

Hi. +1, we have the same issue.

Laravel forge on DigitalOcean CentOS, running Spark 4.0.

I tried to change the APP_URL, but doesn't seem to make it work.

Please help?

halper's avatar

This may work (at least it worked for me):

Update the handle method in Vendor > Laravel > Spark > Interactions > Settings > Profile > UpdateProfilePhoto as:

public function handle($user, array $data)
    {
        $file = $data['photo'];

        $path = $file->hashName('public/profiles');

        // We will store the profile photos on the "public" disk, which is a convention
        // for where to place assets we want to be publicly accessible. Then, we can
        // grab the URL for the image to store with this user in the database row.
        $disk = Storage::disk('local');

       $disk->put($path, $this->formatImage($file));

       if (preg_match('/profiles\/(.*)$/', $user->photo_url, $matches)) {
           $disk->delete('public/profiles/' . $matches[1]);
       }

       $user->forceFill([
           'photo_url' => $disk->url($path),
       ])->save();

   }
4 likes
Korona123's avatar

Is this any update on this. The github links are all 404..

Cronix's avatar

@Korona123 You need to register your github with Spark via the spark website when logged in in order to access the private spark repo, but this was fixed many versions ago.

laminbarrow's avatar

I've hard this same issue with Laravel Spark 6.0 today. To fix it, set you.env APP_URL to a proper URL matching your site. Finally go into your database and change the photo_url url to match your domain in the users table.

I hope that helps.

1 like

Please or to participate in this conversation.