我遇到了在laravel 4中我的UserController中发送密码请求的某个函数的问题.它会检查数据库中是否存在该电子邮件,然后如果用户这样做则发送电子邮件.然后,该函数在表中创建一个令牌,并在电子邮件中的链接末尾发送该令牌.
该函数的作用与在数据库中创建令牌一样,但它似乎有问题,因为我不断收到Maximum execution time
错误.我不知道造成这种情况的原因,似乎与重定向有关.有人可以帮帮我吗?提前致谢!
这是控制器功能:
public function passwordRequest()
{
$data = [
"requested"=>Input::old("requested")
];
if(Input::server("REQUEST_METHOD") == "POST") {
$input = Input::all();
$rules = [
"email" => "required|exists:users,email"
];
$v = Validator::make($input, $rules);
if($v->passes()) {
$credentials = [
"email" => Input::get("email"),
];
Password::remind($credentials, function($message, $user) {
$message->from("request@test.com");
});
$data["requested"] = true;
return Redirect::route("user/request")->with($data);
}
return Redirect::to(URL::route("user/request"))->withInput($data)->withErrors($v);
}
return View::make("user/request", $data);
}
Run Code Online (Sandbox Code Playgroud)
这是routes.php文件:
Route::group(["before"=>"guest"], function() {
Route::any("/", [
"as"=>"user/login",
"uses"=>"UserController@userLogin"
]);
Route::any("/request", [
"as"=>"user/request",
"uses"=>"UserController@passwordRequest"
]);
Route::any("/reset", [
"as"=>"user/reset", …
Run Code Online (Sandbox Code Playgroud) 尝试上传图像时,在开发环境中遇到上述错误。我通过以下操作遵循了其他答案
但我仍然无法克服错误。我做错什么了吗?以下是我的php.ini文件中的相关部分
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 100M
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 125M
Run Code Online (Sandbox Code Playgroud)