小编sab*_*jan的帖子

在laravel中发送邮件时,缺少Illuminate\Support\Manager :: createDriver()的参数1

我的.env文件是:

MAIL_DRIVER=mail
MAIL_HOST=smtp.mandrillapp.com
MAIL_PORT=587
MAIL_USERNAME=sabin.maharjan456@gmail.com
MAIL_PASSWORD=****************************
Run Code Online (Sandbox Code Playgroud)

Mailer.php

  <?php namespace App\Http\Controllers;

class Mailer{
    public function sendTo($email, $subject, $view, $data = array())
    {
        \Mail::queue($view, $data, function($message) use($email, $subject)
        {
            $message->to($email)->subject($subject);
        });
        return "Mail has been sent";

    }

    public function welcome($formData)
    {
        $subject = "User Message was arrived !";
        $data['name'] = $formData['name'];
        $data['email'] = $formData['email'];
        $data['mobile'] = $formData['mobile'];
        $data['subject'] = $formData['subject'];
        $data['bodymessage'] = $formData['message'];
        $view = 'emails.welcome';
        return $this->sendTo(['sabin.maharjan456@gmail.com'],$subject,$view,$data);
    }
}
Run Code Online (Sandbox Code Playgroud)

位指示:

 public function postContactFormRequest(CreateContactFormRequest $request,Mailer $mailer)
{

    $formData = $request->all();

    $this->mailer->welcome($formData);

  } …
Run Code Online (Sandbox Code Playgroud)

email message laravel mandrill

5
推荐指数
1
解决办法
3085
查看次数

我是新手ubuntu.i安装了phpstorm并尝试运行composer但它没有运行

我在ubuntu 14.04安装了phpstorm错误当我尝试使用命令php artisan migrate访问数据库时:

 wwwsabininfonp@wwwsabininfonp-Aspire-E1-471:/opt/lampp/htdocs/fine-arts$ php artisan migrate                                                                                                             
  [PDOException]                                                                                               
  SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)  
Run Code Online (Sandbox Code Playgroud)

当我尝试使用命令组合器更新后发生以下错误:

    Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - gregwar/captcha dev-master requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - gregwar/captcha dev-master requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - Installation request for gregwar/captcha dev-master -> satisfiable by gregwar/captcha[dev-master]. …
Run Code Online (Sandbox Code Playgroud)

php migration ubuntu laravel artisan

2
推荐指数
1
解决办法
2518
查看次数

标签 统计

laravel ×2

artisan ×1

email ×1

mandrill ×1

message ×1

migration ×1

php ×1

ubuntu ×1