aisuvro/laravel-storage-linker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aisuvro/laravel-storage-linker

最新稳定版本:1.1.1

Composer 安装命令:

composer require aisuvro/laravel-storage-linker

包简介

A Laravel package to create symbolic links for storage disks with interactive selection

README 文档

README

Latest Version PHP Version Laravel Version

A Laravel package that provides an interactive way to create symbolic links for all your storage disks with local drivers.

Recent Updates (v1.0.1)

🔧 Fixed: Resolved symbolic link creation issues by replacing hard link creation with proper symbolic links using native PHP symlink() function.

Features

  • 🔗 Interactive symlink creation with disk selection
  • 📋 Display all available local disks in a table format
  • ⚡ Create symlinks for all local disks with --all flag
  • 🗑️ Remove existing symlinks with --remove flag
  • 🔄 Force recreation of existing symlinks with --force flag
  • ✅ Real-time symlink status checking
  • 🛡️ Safe error handling and validation

Installation

You can install the package via composer:

composer require aisuvro/laravel-storage-linker

The package will automatically register itself via Laravel's package discovery feature.

Usage

Interactive Mode

Run the command without any flags to see all available local disks and select which ones to link:

php artisan storage:link-all

This will show you a table with:

  • Disk name
  • Root path
  • Current symlink status

You can then select one or multiple disks to create symlinks for.

Create All Symlinks

To create symlinks for all local disks at once:

php artisan storage:link-all --all

Remove Symlinks

To remove all existing symlinks:

php artisan storage:link-all --remove

Force Recreation

To force recreation of symlinks (even if they already exist):

php artisan storage:link-all --all --force

How It Works

The package scans your config/filesystems.php file for all disks with the local driver and creates symbolic links in the public/storage/{disk-name} directory pointing to the disk's root path.

Example

If you have these disks configured:

// config/filesystems.php
'disks' => [
    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
    ],
    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
    ],
    'uploads' => [
        'driver' => 'local',
        'root' => storage_path('app/uploads'),
    ],
    's3' => [
        'driver' => 's3',
        // ... s3 config (will be ignored)
    ],
],

The package will create:

  • public/storage/localstorage/app
  • public/storage/publicstorage/app/public
  • public/storage/uploadsstorage/app/uploads

The S3 disk will be ignored since it's not a local driver.

Requirements

  • PHP ^8.1
  • Laravel ^9.0|^10.0|^11.0|^12.0

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Security Vulnerabilities

If you discover a security vulnerability, please send an e-mail to info@appenjel.com.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-20