DEV Community

Milan Tarami
Milan Tarami

Posted on

4 1

how to run storage:link in shared hosting

In shared hosting, if you don't have ssh access there is one way to run the artisan command is using Artisan Facade but wait Artisan::call('storage:link') throws an error

We are going to solve this issue, add this code to web.php within a route or to any controller

use Illuminate\Support\Facades\File;

File::link(storage_path('app/public'), public_path('storage'));
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more