繁体   English   中英

我如何在控制器中使用 livewire 组件

[英]how can i use livewire component in controller

如何在控制器中使用 livewire 组件?

$payment = Basket::where('id', $id)->first();
        $orderCode = $payment['order_code'];
        $transaction = Transaction::where('order_code', $orderCode)->first();

        $data = [
            $transaction,
            Auth::guard('customer')->user()
        ];

        // use livewire component

        Notification::send(User::where('position', '=', [17, 19, 20])->get(), new CreditRequestNotification($data));

        return view('user.payment.payment_kind', compact('payment', 'transaction'));

我想在评论的地方使用 livewire 组件

这是错误的:

User::where('position', '=', [17, 19, 20])->get()

利用:

User::whereIn('position', [17, 19, 20])->get()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM