Editable inline content with database persistence

Maintainers

Package info

github.com/brunoabpinto/magic

pkg:composer/brunoabpinto/magic

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.3 2026-01-16 18:17 UTC

This package is auto-updated.

Last update: 2026-02-16 18:32:20 UTC


README

Laravel Magic

Editable inline content with automatic database persistence using Livewire.

Demo

Installation

  1. Install via Composer:
composer require brunoabpinto/magic
  1. Publish and run migrations:
php artisan vendor:publish --tag=magic-migrations
php artisan migrate
  1. (Optional) Publish config:
php artisan vendor:publish --tag=magic-config

Usage

In your Blade views:

@magic('Editable text')

or if you have multiple @magic blocks with the same text and want to keep them separate:

@magic('Editable text', 'my-id')
@magic('Editable text', 'my-other-id')

Features

  • ✅ Inline editing with contenteditable
  • ✅ Automatic database persistence
  • ✅ Cache layer for performance
  • ✅ Reset to original value
  • ✅ Configurable cache and table names

Configuration

After publishing the config file, you can customize:

  • Cache driver
  • Cache prefix
  • Database table name

Requirements

  • PHP 8.1+
  • Laravel 10.0+ or 11.0+
  • Livewire 4.0+

License

MIT