-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.x] Adds about command that Checks storage symbolic links status #54001
base: 11.x
Are you sure you want to change the base?
Conversation
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
@@ -163,6 +163,7 @@ protected function gatherApplicationInformation() | |||
|
|||
$formatEnabledStatus = fn ($value) => $value ? '<fg=yellow;options=bold>ENABLED</>' : 'OFF'; | |||
$formatCachedStatus = fn ($value) => $value ? '<fg=green;options=bold>CACHED</>' : '<fg=yellow;options=bold>NOT CACHED</>'; | |||
$formatStorageLinkedStatus = fn ($value) => $value ? '<fg=green;options=bold>LINKED</>' : '<fg=yellow;options=bold>NOT LINKED</>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$formatStorage = fn ($value) => $value ? '<fg=green;options=bold>AVAILABLE</>' : '<fg=yellow;options=bold>NOT AVAILABLE</>';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or it can also be set to exists or not exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@selcukcukur Hummm... the command that you'd run would be artisan storage:link
which is why I went with Linked. I don't have any strong preferences though.
@@ -175,6 +176,7 @@ protected function gatherApplicationInformation() | |||
'Maintenance Mode' => static::format($this->laravel->isDownForMaintenance(), console: $formatEnabledStatus), | |||
'Timezone' => config('app.timezone'), | |||
'Locale' => config('app.locale'), | |||
'Storage Linked' => static::format(file_exists(public_path('storage')), console:$formatStorageLinkedStatus), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Storage' => array_map(
fn($link) => static::format(file_exists($link), console: $formatStorage),
array_keys(config('filesystems.links'))
),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be more accurate this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@selcukcukur I'll give that a shot!
I've added a section to the
php artisan about
command that shows the status of of thefilesystems
links.While helping some developers debug why their media isn't displaying correctly, it is often a result of forgetting to link the storage folder.
php artisan about
Running
php artisan about
will show that the logs link has not been made.Running
php artisan storage:link
and thenphp artisan about
will show the newly create symbolic link.ref #53656