22 lines
475 B
PHP
22 lines
475 B
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
class MediaDisk
|
|
{
|
|
/**
|
|
* 实际生效的附件磁盘:
|
|
* 默认走 S3(uploads);未配置 S3 密钥时回退本地 public,保证开发环境可用。
|
|
*/
|
|
public static function name(): string
|
|
{
|
|
$configured = config('blog.attachments_disk', 'uploads');
|
|
|
|
if ($configured === 'uploads' && empty(config('media.bucket'))) {
|
|
return 'public';
|
|
}
|
|
|
|
return $configured;
|
|
}
|
|
}
|