我正在尝试让 Laravel 实现的电子邮件验证系统正常工作(https://laravel.com/docs/8.x/verification)。
到目前为止我做了什么:
在文件config/fortify.php中启用功能emailVerification,如下所示:
...
'features' => [
Features::registration(),
Features::resetPasswords(),
Features::emailVerification(),
Features::updateProfileInformation(),
Features::updatePasswords(),
Features::twoFactorAuthentication([
'confirmPassword' => true,
]),
],
...
Run Code Online (Sandbox Code Playgroud)
在app/Models/User.php文件中实现MustVeriffyEmail,如下所示:
<?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Jetstream\HasProfilePhoto;
use Laravel\Jetstream\HasTeams;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable implements MustVerifyEmail
{
use HasApiTokens;
use HasFactory;
use HasProfilePhoto;
use HasTeams;
use Notifiable;
use TwoFactorAuthenticatable;
...
Run Code Online (Sandbox Code Playgroud)
这些更改后的结果:
Chrome 或 Firefox 一切正常,Safari 除外。如果我尝试单击每封邮件收到的电子邮件验证链接,它只会将我重定向到登录页面(在新选项卡中),而不会出现任何错误消息。 …
Tailwind CSS 提供了两种不同的方式在您的网站上启用深色模式。
第一种方式是通过媒体,这意味着您的操作系统是否支持暗模式并且已激活。您的网站将自动以深色模式显示。
我的tailwind.config.js:
module.exports = {
darkMode: 'media',
};
Run Code Online (Sandbox Code Playgroud)
第二种方法是通过“class”,这意味着您的<html>标签是否已class="dark"分配。您的网站将以深色模式显示。
我的tailwind.config.js:
module.exports = {
darkMode: 'class',
};
Run Code Online (Sandbox Code Playgroud)
有没有一种简单的方法可以同时使用这两个选项?
我想要实现的效果是用户可以在“亮”、“暗”和“系统设置”之间设置自己的偏好。
与 Stack Overflow 上使用的函数类似:

如果 Tailwind CSS 目前无法实现此选项,那么最干净、最简单的解决方法是什么?
有关我的项目的信息: