这是我job类中的handle方法
public function handle()
{
$res1 = DB::table('log')->insertGetId(
['op' => 1]
);
}
就是插入一条数据嘛。
在控制器中调用
class IndexController extends Controller
{
public function register() {
$this->dispatch((new ProcessRegister(1))->onQueue('register'));
echo "下单成功!";
}
}
Redis服务已经开启了,访问http://localhost/test后,发现数据库什么数据也没有。。。