magros / laravel-model-encryption Goto Github PK
View Code? Open in Web Editor NEWThis enable store encrypted models in Laravel
License: Apache License 2.0
This enable store encrypted models in Laravel
License: Apache License 2.0
https://laravel.com/docs/5.2/queries#where-clauses
Laravel allows for the where
clause in the query builder to be passed an array of conditions, e.g.
$users = DB::table('users')->where([
['status', '=', '1'],
['subscribed', '<>', '1'],
])->get();
or
$users = DB::table('users')->where([
'status' => '1',
'name' => 'John Doe',
]])->get();
The extended query builder works well to handle queries on encrypted fields when passed via a simple where
clause, but when this more complex structure is passed, the column field never gets recognised, and the value isn't decrypted.
As the title says, encrypted values are stored as lowercase. For instance:
username = ABCdefg
when encrypted it shows as abcdefg , which is a problem with case sensitive fields like usernames and passwords.
Hello,
i think the package is conflict with the current laravel. i got this error when executing:
php artisan encryptable:encryptModel 'App\Models\MyModel'
Illuminate\Database\Eloquent\Model and Magros\Encryptable\Encryptable define the same property ($encrypter) in the composition of App\Models\MyModel. However, the definition differs and is considered incompatible. Class was composed
php artisan vendor:publish --provider=Magros\Encryptable\EncryptServiceProvider
In EncryptServiceProvider.php line 29:
Call to undefined function Magros\Encryptable\config_path()
I am facing encryption issue when i use prefix word in encryptable values then value not encrypting.
Value should encrypt even value contain prefix.
Thanks
https://laravel.com/docs/5.8/validation#rule-unique
Laravel's validation rules allow for except
conditions to be passed to a rule. This allows for validation rules on an update of a user account to ensure that the user's email address is unique, excluding their own user record. This can be done via Rule
objects, or by adding the exceptional values to the piped-format validation rule string.
The syntax would look something like:
'email' => 'required|email|unique:users,email,'.$user_id,
When using the unique_encrypted
validation rule, only the first two parameters get handled. This means that an attempt to update a user record by posting a full user object will throw a validation error due to the email address already existing in the database.
When running php artisan encryptable:encryptModel 'App\User'
it was raised the error: Call to undefined function Magros\Encryptable\str_contains()
Environment:
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.