首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我正在尝试使用Laravel Job Class在队列中发送电子邮件,但它一直在说找不到class

我正在尝试使用Laravel Job Class在队列中发送电子邮件,但它一直在说找不到class
EN

Stack Overflow用户
提问于 2019-09-02 01:26:08
回答 1查看 32关注 0票数 0

如果有任何帮助,我将不胜感激,如果有任何帮助,我正在使用laravel多身份验证系统,并且我为管理相关的控制器创建了一个文件夹。我尝试在Admin子文件夹的RegisterController中使用这个类

如果有任何帮助,我将不胜感激,如果有任何帮助,我正在使用laravel多身份验证系统,并且我为管理相关的控制器创建了一个文件夹。我尝试在Admin子文件夹的RegisterController中使用这个类

代码语言:javascript
复制
<?php

namespace App\Http\Controllers\Agent\Auth;

use App\Agent;
use Illuminate\Http\Request;
use App\Jobs\AgentMailQueuer;
use Illuminate\Support\Facades\Hash;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;


class RegisterController extends Controller
{
    /**
     * Show the register form.
     * 
     * @return \Illuminate\Http\Response
     */
    public function showRegisterForm()
    {
        return view('agent.auth.register',[
            'title' => 'Create A New Agent On This Page.',
            'registerRoute' => 'agent.register',
        ]);
    }



    /**
     * Create a new agent instance after a valid registration.
     *
     * @param  array  $data
     * @return \App\Agent
     */
    public function create(Request $request)
    {

        $this->validate(request(),[
            'firstname' => 'required|string|max:255|alpha|min:2',
            'lastname' => 'required|string|max:255|alpha|min:2',
            'city' => 'required|max:255|min:2',
            'state' => 'required|string|max:255|alpha|min:2',
            'email' => 'required|string|email|max:255|unique:agents',
            'consent' => 'required',
        ]);

        $newAgentId = unique_random('agents', 'aid', 10);
        $newAgentGeneratedPassword = unique_random('agents', 'password', 12);
        $agent = Agent::Create([
            'firstname' => $request['firstname'],
            'lastname' => $request['lastname'],
            'city' => $request['city'],
            'state' => $request['state'],
            'email' => $request['email'],
            'aid' => $newAgentId,
            'password' => Hash::make($newAgentGeneratedPassword),
        ]);

        // Mailing Info to Agents
        AgentMailQueuer::dispatch($agent);

        return redirect()->to('/agent/register')->with('agentcreated', 'New Agent has been Created and their Credentials have been Succesfully Emailed to them !');

    }
}
EN

回答 1

Stack Overflow用户

发布于 2019-09-03 00:45:31

通过更改Job类的名称解决了该问题。

(由提问者回答)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57748090

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档