avatar

麦兜的小站

MDO.INK

  • 首页
  • 随笔
  • 知识库
  • 归档
  • 动态
  • 标签
  • 关于
Home Laravel 5.4 Storage link
文章

Laravel 5.4 Storage link

Posted 2025-06-24 Updated 2025-06- 24
By power 已删除用户
5~7 min read

First of all in the .env file create a variable named FILESYSTEM_DRIVER and set it to public like this

FILESYSTEM_DRIVER=public

and then create symbolic link by run

php artisan storage:link

after that just use asset()

<img src="{{ asset('storage/'.$cv->photo) }}" alt="...">

It'll work fine 😊

2

Go to public directory:

cd public

Run this to remove the Storage folder:

rm -r storage

Go back to project root:

cd ..

Then run:

php artisan storage:link

The public disk is intended for files that are going to be publicly accessible. By default, the public disk uses the local driver and stores these files in storage/app/public. To make them accessible from the web, you should create a symbolic link from public/storage to storage/app/public. Laravel doc

Create Symbolic link in Linux

ln -s source_file myfile

3

solved it with just a simple modification on the filesystems config/file systems from :

'local' => [
            'driver' => 'local',
            'root' => storage_path('app'),
        ]

to :

'local' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
        ]

if you're unable to create symblink on LAMP via running

php artisan storage:link 

then run

 ln -s public_html/storage/app/public public_html/public/storage

if your not in public_html or at root folder then run

  ln -s /application/xyhpnqyw/public_html/storage/app/public /application/xyhpnqyw/public_html/public/storage
    target='/application/xyhpnqyw/public_html/storage/app/public'
    shortcut='/application/xyhpnqyw/public_html/public/storage'
知识库
License:  CC BY 4.0
Share

Further Reading

Jul 31, 2025

如何实现接口幂等性

通俗的说,用户在系统中有操作,不管重复多少次,都应该产生一样的效果或返回一样的结果的。 幂等性的概念 幂等(Idempotent)是一个数学与计算机学的概念,常见于抽象代数中。 f(n)=1^n//无...

Jul 19, 2025

10个npm工具包

有了npm之后,前端人员真的是过上好日子了。我们可以直接把别人写好的工具包拿来用,非常的方便。 1.day.js-轻量日期处理 npminstalldayjs importdayjsfrom'd...

Jul 17, 2025

How to set up PHP7.4 on MacOS.

Thisisallverywellandgood.Apartfromonesmallinsignificantthing… TheversionofPHPinuseiscurrently7.4. Th...

OLDER

从视频流中提取每一帧图像

NEWER

一条命令设置文件夹755,网页文件644权限

Recently Updated

  • 如何实现接口幂等性
  • 10个npm工具包
  • How to set up PHP7.4 on MacOS.
  • Automa:一键自动化,网页数据采集与工作流程优化专家Automa:解锁自动化
  • Mac 下用 brew 搭建 LNMP

Trending Tags

thinkphp clippings

Contents

©2025 麦兜的小站. Some rights reserved.

Using the Halo theme Chirpy