Comments (6)
Yes, this Hash
library can only encode/decode numeric keys, which indeed aims to provide some level of security in production. It will not work with non-numeric keys though, but I'll come up with a solution for that in a later release, thanks! In the meantime I can recommended setting secret
to false
on guid
, which should skip the encoding part.
from laraform.
Setting secret to false, I had already tried, does not work, the logic still enters setKeyFormData() and in there it correctly enters the if where it attempts the Hash:decode($key); which returns an empty array.
My workaround works though (!?)
from laraform.
I've changed my workaround, left ln 814 at Laraform.php as it was, and changed ln 28 of Support/Hash.php from;
return (new Hashids(md5(env('APP_KEY')), 10))->decode($value)[0]
to
return (new Hashids(md5(env('APP_KEY')), 10))->decode($value)[0] ?? $value;
from laraform.
If your fix works, it's fine, but I'll look into the issue anyway. A whole example with model and migration would help though.
from laraform.
Table looks like;
CREATE TABLE
objects
(
guid
char(40) COLLATE utf8mb4_unicode_ci NOT NULL,
name
varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
type
varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
status
varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
_props
longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
UNIQUE KEYobjects_guid_unique
(guid
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Model has nothing special, looks like;
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Arr;
use Laravel\Scout\Searchable;class Obj extends Model
{
use Searchable;
//
protected $connection;
protected $table = 'objects';
protected $primaryKey = 'guid';
protected $keyType = 'string';
protected $casts = [
'_props' => 'json',
];
public $incrementing = false;
}
from laraform.
Hi! I've created a new bug report template, so if you still have the issue please resubmit accordingly: https://github.com/laraform/laraform/issues/new?assignees=&labels=bug&template=1_bugs.md&title=%5BBUG%5D
(was not able to reproduce the bug because I was thrown "Unknown column" sql error)
from laraform.
Related Issues (20)
- If the submit button is clicked in a form, how can it automatically scroll to the first validation error if an error exists HOT 3
- [BUG] validation rule "before" and "before_or_equal" for date elements not working as expected HOT 2
- [QUESTION] is Possible to Drag n Drop component like google form? HOT 3
- [BUG] validation is not running on "onInput" event for TextElement (inputType="number") HOT 2
- [QUESTION] Planned support for Tailwind CSS? HOT 4
- [QUESTION] Does full version comes with uncompress version of JS code ? HOT 4
- [BUG] Trouble initiating laraform with laravel-pug (pugjs) HOT 4
- Support !!! [BUG] HOT 5
- [BUG] storing files in related model using AutoProcess and Wizard HOT 2
- [QUESTION] Custom schema for edit HOT 3
- [QUESTION] Hide Radio Group items HOT 2
- [BUG] PHP 8.1: HasMany::hasKey throws error HOT 6
- [BUG] PHP8.1/L9: HasMany::update fails if model has appended attributes HOT 4
- [BUG] AlgoliaSearchError HOT 4
- [BUG] Regexp mask for text inputs from backend HOT 4
- Maintenance Mode / Laraform Future / Vue.js 3 HOT 2
- Client-Side Storage HOT 2
- [BUG] Class "Route" not found (Laravel)
- [BUG] Form not showing after install HOT 4
- [QUESTION] Ignore data on submit HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laraform.