404 not found in console laravel and ajax

Thank you thank you very much James_Hibbard,


sorry but I don’t understand what you mean can you explain with exemple or code because I don’t know what to do ( sorry but I tried to see some tutorials and follow them to learn something new for me and to learn from my mistakes) and please advice me what to do if it happen again with other code thank you very much
wishlistController:


    public function store(Request $request)
    {

      $product_id= $request->product_id;
if( Wishlist::where('user_id',auth()->id())->where('product_id',$product_id)->exists())
{
return response() -> json(['status' => "This Product is already in your wishlist "]);
}
else
{
       $wishlist = new Wishlist;

       $wishlist->user()->associate($request->user());

       $wishlist->product_id = $product_id;
        $wishlist->save();
        return response() -> json(['status' => "Product added to wishlist"]);
     
   }