强迫症患者对filamentphp主题的执着

中秋佳节至,月儿圆又明。千里共婵娟,思念随风行。祝您中秋快乐,阖家幸福安康,万事如意顺心。

强迫症患者对filamentphp主题的执着

强迫症患者对filamentphp主题的执着

强迫症患者对filamentphp主题的执着

强迫症患者对filamentphp主题的执着

强迫症患者对filamentphp主题的执着

强迫症患者对filamentphp主题的执着

强迫症患者对filamentphp主题的执着

本作品采用《CC 协议》,转载必须注明作者和本文链接
Ryan
Mumujin
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 11

请问filament导出cvs的时候怎么在浏览器中导出,而不是本地呢

10个月前 评论
阿珂 10个月前

这个 设置 用的是哪个插件 :+1:

10个月前 评论
Mumujin (楼主) 10个月前
Mumujin

@Hetoo


enum StorageProvider: string implements HasLabel, HasIcons, HasDescriptions, HasColor
{
    use WithOptions;

    case Oss = 'oss';

    case S3 = 's3';

    case Qiniu = 'qiniu';

    case Local = 'local';

    public function getLabel(): ?string
    {
        return match($this) {
            static::Local => '本地服务器 (Local)',
            static::Oss => '阿里云 (OSS)',
            static::S3 => '亚马逊 (Amazon S3)',
            static::Qiniu => '七牛云 (Kodo)',
        };
    }

     public function getColor(): string | array | null
     {
         return match($this) {
            static::Local => 'text-gray-700 dark:text-gray-400',
            static::Oss => 'text-warning-400 dark:text-warning-500',
            static::S3 => 'text-warning-400 dark:text-warning-500',
            static::Qiniu => 'text-info-400 dark:text-info-500',
        };
     }

    public function getDescriptions(): ?string
    {
        return '';
    }

    public function getIcons(): ?string
    {
        return match($this) {
            static::Local => 'heroicon-o-computer-desktop',
            static::Oss => 'module-settings::components.icons.aliyun',
            static::S3 => 'module-settings::components.icons.amazon',
            static::Qiniu => 'module-settings::components.icons.qiniu',
        };
    }
}

RadioDeck::make('default_provider')
                    ->label(__('module-settings::pages/settings-page.form.storage.default_provider.label'))
                    ->helperText(__('module-settings::pages/settings-page.form.storage.default_provider.help'))
                    ->options(StorageProvider::class)
                    ->icons(StorageProvider::class)
                    ->descriptions(StorageProvider::class)
                    ->required()

时间格式


use DateTimeZone;
use IntlTimeZone;
use Illuminate\Support\Facades\App;
use Symfony\Component\Intl\Timezones;
use Ofcold\ModuleSetting\Enums\TimeFormat;

class Timezone
{
    public static function getTimezoneOptions(?string $countryCode = 'CN'): array
    {
        if (empty($countryCode)) {
            return [];
        }

        $countryTimezones = self::getTimezonesForCountry($countryCode);

        if (empty($countryTimezones)) {
            return [];
        }

        $localizedTimezoneNames = Timezones::getNames(App::getLocale());

        $results = [];

        foreach ($countryTimezones as $timezoneIdentifier) {
            $timezoneConical = IntlTimeZone::getCanonicalID($timezoneIdentifier);
            $translatedName = $localizedTimezoneNames[$timezoneConical] ?? $timezoneConical;
            $cityName = self::extractCityName($translatedName);
            $localTime = self::getLocalTime($timezoneIdentifier);
            $timezoneAbbreviation = now($timezoneIdentifier)->format('T');

            $results[$timezoneIdentifier] = "{$cityName} ({$timezoneAbbreviation}) {$localTime}";
        }

        return $results;
    }

    public static function extractCityName(string $translatedName): string
    {
        if (preg_match('/\((.*?)\)/', $translatedName, $match)) {
            return trim($match[1]);
        }

        return $translatedName;
    }

    public static function getLocalTime(string $timezone): string
    {
        return now($timezone)->translatedFormat(TimeFormat::DEFAULT);
    }

    public static function getTimezonesForCountry(string $countryCode): array
    {
        return DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, strtoupper($countryCode));
    }
}

enum DateFormat: string implements HasLabel
{
    // Day-Month-Year Formats
    case DMY_SLASH = 'd/m/Y'; // 31/12/2021
    case DMY_DASH = 'd-m-Y'; // 31-12-2021
    case DMY_DOT = 'd.m.Y'; // 31.12.2021
    case DMY_SPACE = 'd m Y'; // 31 12 2021
    case DMY_LONG = 'd F Y'; // 31 December 2021
    case DMY_SHORT = 'd M Y'; // 31 Dec 2021

    // Month-Day-Year Formats
    case MDY_SLASH = 'm/d/Y'; // 12/31/2021
    case MDY_DASH = 'm-d-Y'; // 12-31-2021
    case MDY_DOT = 'm.d.Y'; // 12.31.2021
    case MDY_SPACE = 'm d Y'; // 12 31 2021
    case MDY_LONG_SPACE = 'F d Y'; // December 31 2021
    case MDY_LONG_COMMA = 'F j, Y'; // December 31, 2021
    case MDY_SHORT_SPACE = 'M d Y'; // Dec 31 2021
    case MDY_SHORT_COMMA = 'M j, Y'; // Dec 31, 2021

    // Year-Month-Day Formats
    case YMD_SLASH = 'Y/m/d'; // 2021/12/31
    case YMD_DASH = 'Y-m-d'; // 2021-12-31
    case YMD_DOT = 'Y.m.d'; // 2021.12.31
    case YMD_SPACE = 'Y m d'; // 2021 12 31
    case YMD_LONG = 'Y F d'; // 2021 December 31
    case YMD_SHORT = 'Y M d'; // 2021 Dec 31

    public const DEFAULT = self::MDY_SHORT_COMMA->value;

    public function getLabel(): ?string
    {
        return now()->translatedFormat($this->value);
    }
}

enum TimeFormat: string implements HasLabel
{
    // 12-Hour Formats
    case G12_CAP = 'g:i A'; // 5:30 AM
    case G12_LOW = 'g:i a'; // 5:30 am
    case H12_CAP = 'h:i A'; // 05:30 AM
    case H12_LOW = 'h:i a'; // 05:30 am

    // 24-Hour Formats
    case G24 = 'G:i'; // 5:30
    case H24 = 'H:i'; // 05:30

    public const DEFAULT = self::G12_CAP->value;

    public function getLabel(): ?string
    {
        return Carbon::createFromTime(5, 30)->translatedFormat($this->value);
    }
}
10个月前 评论
Hetoo 10个月前

请问通用以下的menu是用cluster列出来对吗?

10个月前 评论
Mumujin (楼主) 10个月前
Cooper

既然都强迫症了

file

10个月前 评论
Mumujin (楼主) 10个月前

6啊,主题开源吗?

10个月前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!