Skip to content
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

Draft
wants to merge 7 commits into
base: 11.x
Choose a base branch
from
2 changes: 2 additions & 0 deletions src/Illuminate/Foundation/Console/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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</>';
Copy link
Contributor

@selcukcukur selcukcukur Jan 29, 2025

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</>';

Copy link
Contributor

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.

Copy link
Contributor Author

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.


static::addToSection('Environment', fn () => [
'Application Name' => config('app.name'),
Expand All @@ -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),
Copy link
Contributor

@selcukcukur selcukcukur Jan 29, 2025

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'))
),

Copy link
Contributor

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.

Copy link
Contributor Author

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!

]);

static::addToSection('Cache', fn () => [
Expand Down