我使用 Woocommerce,实际上我只收到一封电子邮件的订单通知。我希望根据客户所在位置通过两封不同的电子邮件收到有关订单的通知:
Mail #1 (mail1@mail.com),Mail #2 (mail2@mail.com)。我在网上寻找一些函数,但我发现只有发送到两个电子邮件地址的函数,但没有任何 If 条件。
我需要的是这样的东西:
if ($user->city == 'Germany') $email->send('mail1@mail.com')
else $email->send('mail2@mail.com')
Run Code Online (Sandbox Code Playgroud)
我可以使用哪个钩子来使其工作?
谢谢。
我正在学习Laravel一段时间,我为自己创建了一些基本项目,但今天我尝试使用更多整数来迁移表.但它仍然需要一个错误.
每个整数都尝试auto_increment和primary,这可能是个问题,但我不知道,如何解决它.
Schema::create ('users', function (Blueprint $table)
{
$table->increments ('id');
$table->string ('email')->unique();
$table->string ('pass',250);
$table->integer ('tickets',4);
$table->integer ('tokens',4);
$table->integer ('in_raffle',4);
$table->text ('profile',500);
$table->string ('ip',20);
$table->integer ('ban',1);
$table->integer ('notice',1);
$table->timestamp ('last_login');
});
Run Code Online (Sandbox Code Playgroud)
https://s28.postimg.org/fh3uaqdct/screen2.jpg
有人可以告诉我,我该如何解决这个问题?编辑什么才能正常工作?
非常感谢,祝你有愉快的一天!
当我尝试重定向我的注销时,需要询问错误
这是UserController:
public function logout()
{
Auth::logout();
return redirect()->route('auth/login');
}
Run Code Online (Sandbox Code Playgroud)
这是我的路线:
Route::get('/', function () {
return view('welcome');
});
// Authentication routes...
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
// Registration routes...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');
Route::get('testing', 'UserController@test');
Route::get('logout', 'UserController@logout');
Run Code Online (Sandbox Code Playgroud)
我想,在路线上一切正常,我正确定义了登录(如Laravel文档)
但它仍然需要这个错误:
InvalidArgumentException in UrlGenerator.php line 306:
Route [auth/login] not defined.
Run Code Online (Sandbox Code Playgroud)
有什么问题可以取悦吗?我犯了什么错吗?
非常感谢,祝你有愉快的一天!
php ×3
laravel-5.1 ×2
laravel ×1
migration ×1
mysql ×1
orders ×1
routes ×1
woocommerce ×1
wordpress ×1