Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dynamic Table Updater Laravel Package

rasel9w9/dynamic-table-updater

View on GitHub
Deep Wiki
Context7
## Getting Started
Install the package via Composer:
```bash
composer require rasel9w9/dynamic-table-updater

Publish the configuration (if needed) and register the service provider in config/app.php under providers. The package enables real-time table updates without page reloads.

First Use Case: Trigger dynamic updates via a Blade directive or JavaScript hook:

// In a controller or Blade file
@dynamicTableUpdate('users', ['id' => 1], ['name' => 'John Doe'])

Or via JavaScript:

DynamicTableUpdater.update('users', { id: 1 }, { name: 'John Doe' });

Implementation Patterns

Blade Integration

Use the @dynamicTableUpdate directive to bind table updates to form submissions or button clicks:

<form action="{{ route('update.user') }}" method="POST">
    @dynamicTableUpdate('users', ['id' => $user->id], ['name' => $name])
    <button type="submit">Update</button>
</form>

API/JS Integration

For SPAs or AJAX-heavy apps, use the JavaScript API:

// Listen for changes and auto-update
document.querySelector('#update-btn').addEventListener('click', () => {
    DynamicTableUpdater.update('users', { id: 123 }, { status: 'active' });
});

Event-Based Workflows

Leverage Laravel events to trigger updates globally:

// In an EventServiceProvider
public function boot()
{
    UserUpdated::listen(function ($user) {
        DynamicTableUpdater::queueUpdate('users', $user->toArray());
    });
}

Gotchas and Tips

Configuration Quirks

  • Ensure table_updater middleware is registered in app/Http/Kernel.php if using API routes.
  • Check config/dynamic-table-updater.php for rate-limiting or queue settings.

Debugging

  • 404 Errors: Verify the table name and primary key match your database schema.
  • Silent Failures: Enable debug mode in config to log failed updates:
    'debug' => env('APP_DEBUG', false),
    

Extension Points

  • Custom Handlers: Override the default update logic by binding to DynamicTableUpdater::updating event.
  • Queue Support: Use DynamicTableUpdater::queueUpdate() for background processing:
    DynamicTableUpdater::queueUpdate('posts', $postData, 'high');
    

Performance

  • Batch updates for bulk operations:
    DynamicTableUpdater::batchUpdate('orders', $orderIds, ['status' => 'shipped']);
    
  • Cache table metadata if updates are frequent.

**NO_UPDATE_NEEDED** for prior versions (this is the first assessment).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nasirkhan/laravel-sharekit
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony