Skip to content

StorageLinkCommand fails even with --force option #56070

Closed
@rodrigopedra

Description

@rodrigopedra

Laravel Version

12.19.0

PHP Version

8.2.28

Database Driver & Version

any

Description

StorageLinkCommand fails even with --force option

After PR #55994 the command below

php artisan storage:link --force

No longer works.

PR #55994 added a is_file() check before deleting a file. But that check returns false for a symlink.

Therefore, any existing links are not deleted here:

if (is_link($link)) {
$this->laravel->make('files')->delete($link);
}

ping @taylorotwell @crynobone

I can't work on a PR right now.

Steps To Reproduce

  1. Create a new Laravel app
  2. Run php artisan storage:link --force twice (1st time to create the links, second time to fail)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions