۴۰۴ Not Found! قیمت ها به ۴۰۳ برگشت! به مدت محدود!
بزن بریم!سلام بنده یک چیزی درست کردم که وقتی کاربر کامنت در صفحه سینگل محصول ثبت کرد یک نوتیفیکیشن برای کاربر ادمین ارسال شود و همه چیز انجام میشه فقط مشکل اصلی من نحوه و چگونی ارسال روت صفحه سینگل محصول به نوتیفیکیشن هست.؟؟؟
این کد کنترلر کامنت
public function comment(Request $request,Product $product)
{
$data = $request->validate([
'commentable_id' => 'required',
'commentable_type' => 'required',
'description' => 'required',
'parent_id' => 'required',
]);
auth()->user()->comments()->create($data);
//Notification For Admin
$user=User::query()->where('is_supper_user',1)->get();
Notification::send($user,new CommentAnnouncementForAdmin('اینجا چی قرار بدم که به صفحه سینگل محل که کامنت در اون وجود داره هدایت کنه؟'));
alert()->message('پس از تایید در سایت نمایش داده خواهد شد', 'دیدگاه شما با موفقیت ثبت شد')->autoclose('4000');
return back();
}
URL صفحه سینگل به این شکل هست http://localhost:8000/products/1
اینم Notification
protected Comment $comment;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(Comment $comment)
{
$this->comment = $comment;
}
public function toDatabase($notifiable)
{
return [
'route'=>route(؟),
];
}
```اینم روت صفحه سینگل محصول
Route::get('/products/{product}', [ProductController::class, 'single']);
سلام خسته نباشید
ببین میتونی یه id بهش بفرستی یعنی id محصول بعد توی notification بیای بزنی route('products.single' , $id)
آیا مایل به ارسال نوتیفیکیشن و اخبار از طرف راکت هستید ؟