By default Livewire exposes database connection details. See the following discussion for details.
This package encrypts memo.dataMeta.models
and memo.dataMeta.modelCollections
responses, so your database details cannot easily be retrieved.
NOTE: This package is a POC and comes without any warranty it actually working.
You can install the package via composer:
composer require foxws/livewire-encrypt
This package should auto-register and overrule the Livewire HydratePublicProperties
class.
NOTE: By default Livewire exposes model properties to the view, unless it's defined in the model's
$hidden
property.
When using Filament, one may want to force route-binding instead, and use the following trait on the Edit/View page:
<?php
namespace App\Admin\Concerns;
trait InteractsWithFormData
{
protected function mutateFormDataBeforeFill(array $data): array
{
return $this->prepareFormDataBeforeFill($data);
}
protected function prepareFormDataBeforeFill(array $data): array
{
// Replace model id with route-key
$data['id'] = $this->getRecord()->getRouteKey();
if (array_key_exists('prefixed_id', $data)) {
unset($data['prefixed_id']);
}
return $data;
}
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.