簡體   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