<?php
namespace App\Events;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class ChatRoom implements ShouldBroadcast
{
public $data;
private $channels;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($channels, $data)
{
//
$this->channels = $channels;
$this->data = $data;
}
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return $this->channels;
}
}
{
"Login": "登陆",
"E-Mail Address": "邮箱",
"Password": "密码",
"Remember Me": "记住我",
"Forgot Your Password?": "忘记密码?",
"Register": "注册",
"Name": "姓名",
"Confirm Password": "重复密码",
"Reset Password": "重设密码",
"Send Password Reset Link": "发送邮件",
"Logout": "退出",
"Reset Password Notification": "找回密码",
"You are receiving this email because we received a password reset request for your account.": "您收到此电子邮件,因为我们收到了找回密码请求您的账户。",
"If you did not request a password reset, no further action is required.": "如果没有请求找回密码,则不需要进一步的操作。",
"Hello!": "您好!",
"Regards": "真挚问候",
"If you’re having trouble clicking the ": "如果您不能点击"
}
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class ResetPassword extends Notification
{
use Queueable;
/**
* The password reset token.
*
* @var string
*/
public $token;
/**
* Create a notification instance.
*
* @param string $token
* @return void
*/
public function __construct($token)
{
$this->token = $token;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('找回密码')
->line('您收到此电子邮件,因为我们收到了找回密码请求您的账户。')
->action('重设密码', route('password.reset', $this->token))
->line('如果没有请求找回密码,则不需要进一步的操作。');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}
app\User.php
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Notifications\ResetPassword as ResetPasswordNotification;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
}
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t
oo long; max key length is 767 bytes (SQL: alter table `users` add unique `
users_email_unique`(`email`))
use Illuminate\Support\Facades\Schema;
public function boot()
{
//
Schema::defaultStringLength(191);
}
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
#php.ini加
extension =mongodb.so
php composer.phar require jenssegers/mongodb
提示错误,php扩展mbstring错误,用phpize编译安装mbstring
Your requirements could not be resolved to an installable set of packages.
Problem 1
- danielstjules/stringy 1.10.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- danielstjules/stringy 1.10.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- danielstjules/stringy 1.10.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- Installation request for danielstjules/stringy == 1.10.0.0 -> satisfiable by danielstjules/stringy[1.10.0].
Installation failed, reverting ./composer.json to its original content.
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
php artisan key:generate
[Dotenv\Exception\InvalidFileException]
Dotenv values containing spaces must be surrounded by quotes.
.env文件中文或者空格必须加引号
OpenSSL extension is required
打开php.ini启用php_openssl
Key path “file://storage\oauth-public.key” does not exist or is not readable
php artisan passport:install
[Composer\Downloader\TransportException] The “https://packagist.phpcomposer.com/p/provider-2017-07%24c3e8d929d5d06fa b76cef9c5b5e4305dbe89c1599b79e63eee70490a6b8df914.json” file could not be d ownloaded (HTTP/1.1 404 Not Found)
LogicException Key path “file:///storage/oauth-public.key” does not exist or is not readable
chown www-data:www-data storage/oauth-*.key
chmod 600 storage/oauth-*.key
[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))
AppServiceProvider.php
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
Illuminate\Database\QueryException : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
C:\ProgramData\MySQL\MySQL Server 8.0\my.ini里default_authentication_plugin=caching_sha2_password改default_authentication_plugin=mysql_native_password