DeveloperBreeze

Tutorials Programming Tutorials, Guides & Best Practices

Explore 149+ expertly crafted tutorials tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.

Managing WYSIWYG Editors with Livewire: A Step-by-Step Guide

Tutorial August 14, 2024
javascript php

Include the following JavaScript in your Blade file or in a separate JavaScript file:

    document.addEventListener('livewire:load', function() {
        Livewire.on('elementAdded', (data) => {
            $('.custom-editor').summernote({
                height: 200,
                callbacks: {
                    onPaste: function(contents, $editable) {
                        var pastedText = contents;
                        var wireId = $(this).data('wire-id');
                        if (wireId) {
                            Livewire.emit('updateContent', wireId, pastedText);
                        }
                        return false;
                    },
                    onChange: function(contents, $editable) {
                        var typedText = contents;
                        var wireId = $(this).data('wire-id');
                        if (wireId) {
                            Livewire.emit('updateContent', wireId, typedText);
                        }
                    }
                }
            });
        });
    });

Building a GraphQL API with Node.js and Apollo Server

Tutorial August 12, 2024
javascript nodejs graphql

Once you have a basic GraphQL server set up, you can explore more advanced features such as arguments, variables, and real-time subscriptions.

GraphQL allows you to pass arguments to fields and use variables in queries for dynamic data fetching.