草庐IT

Controllers-Swift

全部标签

php - 类 App\Http\Controllers\UserController 不存在

加载路由/users或/user/add时出现问题并返回错误;ReflectionExceptioninRoute.phpline280:ClassApp\Http\Controllers\App\Controllers\UserControllerdoesnotexistUserController确实存在,但它不在我的Controller文件夹中的文件夹中。我的路由文件;Route::group(['middleware'=>'auth'],function(){Route::get('/route/selector','PagesController@selectRoute');

php - Laravel: Trait method guard 没有被应用,因为与 App\Http\Controllers\Auth\AuthController 上的其他 trait 方法有冲突

我正在更新到Laravel5.4并收到此错误消息:Traitmethodguardhasnotbeenapplied,becausetherearecollisionswithothertraitmethodsonApp\Http\Controllers\Auth\AuthController这是我的AuthController类。middleware($this->guestMiddleware(),['except'=>['getLogout']]);}/***Getavalidatorforanincomingregistrationrequest.**@paramarray$d

php - "Type error: Too few arguments to function App\Http\Controllers\UserController::attendance(), 0 passed and exactly 1 expected"

我的数据库中有两个表,分别是用户表和出勤表。我现在想做的是根据用户在与他们的个人资料相关联的出勤View中显示数据库中的出勤数据。这是我在userController中的考勤功能。publicfunctionattendance($id){$user=UserProfile::findOrFail($id);$this->authorize('modifyUser',$user);returnview('user.attendance',['user'=>$user]);}这是我到出勤View的路径。Route::get('/attendance/',['as'=>'user.atte

php - Swift Mailer 邮件发送问题

我已经从他们的网站下载了SwiftMailer并尝试使用以下代码发送简单的电子邮件setUsername('yourusername')->setPassword('yourpassword');$mailer=Swift_Mailer::newInstance($transport);//Createamessage$message=Swift_Message::newInstance('WonderfulSubject')->setFrom(array('john@doe.com'=>'JohnDoe'))->setTo(array('receiver@domain.org','o

php - Swift Mailer 附件

我正在使用PHP即时创建CSV,然后我需要将此CSV文件附加到SwiftMailer消息。我尝试在创建的文件上使用file_get_content以及在创建的文件上使用chunk_split(base64_encode(file_get_contents())以及在将文件写入磁盘之前附加文件。没有写入磁盘我在CSV中得到Rescource#183,附加它与file_get_content我在CSV文件的每一行中只得到一个字符串,有人知道我做错了什么吗?if(!file_exists(_PS_ORDERS_DIR_.$orderDate.'/'.$file_name.'.csv')){i

php - 找不到类 'App\Http\Controllers\Controller' - Laravel 5.2

我是新来的,但我已经在这里检查了所有关于我的问题的解决方案,但仍然没有解决。我想在Laravel5.2中使用教程创建简单的应用程序,但我无法让我的Controller工作。我将我的应用程序命名为“test”,这是一个代码:PagesController.php:路由.php:Route::get('about',['as'=>'about','uses'=>'PagesController@getAbout']);和Controller.php(默认):你看到这里有什么问题了吗?我确定所有文件都在正确的文件夹中。 最佳答案 如果Ap

php - 使用 Swift 邮件程序发送邮件时出现 501 错误

setUsername('user@connect.polyu.hk')->setPassword('pw');//CreatetheMailerusingyourcreatedTransport$mailer=Swift_Mailer::newInstance($transport);//Createamessage$message=Swift_Message::newInstance('WonderfulSubject')->setFrom(array('john@doe.com'=>'JohnDoe'))->setTo(array('foodil@hotmail.com','fo

php - 调用未定义的方法 App\Http\Controllers\SubscriptionController::getMiddleware()

我在我的应用程序中调用\prelaunch路由,这是它在我的routes.php中的定义方式:`Route::get('/prelaunch',['uses'=>'SubscriptionController@getReferrer','as'=>'subscriber.referral'],function(){returnview('prelaunch');});`但不幸的是,我得到:调用未定义的方法App\Http\Controllers\SubscriptionController::getMiddleware()这是我的SubscriptionController代码草稿:n

php - 使用 swift 的多部分电子邮件

在iPhone上时,多部分邮件无法在Gmail上正确显示。我有:$message->setBody($this->body,'text/html');$message->addPart($this->text_body,'plain/text');我也用过:$message->addPart($this->body,'text/html');$message->addPart($this->text_body,'plain/text');但在这两种情况下,当从iPhone读取gmail时,我收到的消息都是“MIME附件”...没有html,甚至无法读取MIME附件。如果我不添加文本部分

PHP fatal error : 'Swift_TransportException' with message 'Failed to authenticate on SMTP server

我知道之前有人问过这个问题,我已经阅读了那里的所有帖子,但我仍然找不到解决方案。我有一台安装了wamp的Windows机器。当我尝试通过谷歌的SMTP服务器发送一封简单的电子邮件时,一切正常。但是,当我将相同的脚本复制到Ubuntu12机器时,它给了我这个错误:PHPFatalerror:Uncaughtexception'Swift_TransportException'withmessage'FailedtoauthenticateonSMTPserverwithusername"xxx@gmail.com"using2possibleauthenticators'in/home/