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

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

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

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

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

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

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

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

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

本作品采用《CC 协议》,转载必须注明作者和本文链接
Ryan
Mumujin
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
讨论数量: 11

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

5个月前 评论
阿珂 5个月前

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

5个月前 评论
Mumujin (楼主) 5个月前
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);
    }
}
5个月前 评论
Hetoo 5个月前

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

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

既然都强迫症了

file

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

6啊,主题开源吗?

5个月前 评论

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