<script>
    //For provider description...
    tinymce.init({
      selector: '#provider_academic',
      plugins: [
        "advlist autolink lists link image charmap print preview hr anchor pagebreak",
        "searchreplace wordcount visualblocks visualchars code fullscreen",
        "insertdatetime media nonbreaking save table contextmenu directionality",
        "emoticons template paste textcolor colorpicker textpattern textcolor"
      ],
      toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | image | forecolor backcolor",
      images_upload_url: '/upload-image-for-provider',  // Server endpoint for image uploads

      images_upload_handler: function (blobInfo, success, failure) {
        const formData = new FormData();
        formData.append('file', blobInfo.blob(), blobInfo.filename());

        fetch('/upload-image-for-provider', {
          method: 'POST',
          body: formData,
          headers: {
            'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>'  // Include the CSRF token
          }
        })
        .then(response => {
          if (!response.ok) {
            throw new Error('Network response was not ok');
          }
          return response.json();
        })
        .then(data => success(data.location))
        .catch(error => failure('Image upload failed: ' + error));
      }

    });
</script><?php /**PATH E:\Project\Personal-Project\Office-Project\update\skin-care\resources\views/admin/provider/partial/tinymce.blade.php ENDPATH**/ ?>