1
0
Fork 0
mirror of https://github.com/archtechx/virtualcolumn.git synced 2025-12-12 04:04:04 +00:00
Commit graph

38 commits

Author SHA1 Message Date
4664d00099
Merge pull request #24 from archtechx/fix-tests
Include timestamps in `getCustomColumns()` by default, fix tests (use new #[Test] attribute)
2025-12-06 16:41:58 +01:00
lukinovec
9da2d6fe8d
Test that with encrypted casts, the encrypted values are saved in the DB (#21) 2025-12-06 16:34:56 +01:00
lukinovec
2fd259b0e9 Add timestamp columns to the default getCustomColumns() 2025-07-22 13:09:08 +02:00
lukinovec
bb38940cbf Add regression test for timestamps being included in the data column 2025-07-22 13:08:27 +02:00
lukinovec
ab128b1fbc Make running tests work (undocumented PHPUnit change) 2025-07-22 12:12:31 +02:00
Samuel Štancl
75718edcfe
update supported version in readme 2025-02-25 14:12:44 +01:00
c799a9fe2a update CI matrix 2025-02-25 13:09:31 +01:00
Samuel Štancl
efef0f1bdb
use >= version constraints 2025-02-14 14:30:47 +01:00
Nick
65f9000328
Handle encrypted columns which are set to null (#19)
* 🧪 Add a test for a null value

* 🐛 Don't consider null types for decryption
2024-04-07 20:26:29 +02:00
Samuel Štancl
7371aac2ab
Laravel 11 support (#17) 2024-01-27 22:49:31 +01:00
Samuel Štancl
89e00fbcd9 make getCustomColumns() and getDataColumn() static again 2023-11-08 22:32:12 +01:00
lukinovec
72de33a3d4
Add encrypted casts support + allow using the trait on multiple models (#14)
* Add encrypted casts test (wip)

* Handle and test 'encrypted' casts

* Add APP_KEY to phpunit.xml

* Update attribute casting in VirtualColumn

* Test casting of all default 'encrypted' castables

* Fix code style (php-cs-fixer)

* Handle custom castables in VirtualColumn

* Add custom encrypted castable

* Test custom encrypted castable, refactor test

* Move EncryptedCast class to VirtualColumnTest

* Correct expected/actual value order in assertions

* Break code style (testing)

* Fix code style (php-cs-fixer)

* Check Laravel CI version (testing)

* dd() Laravel version

* Delete dd()

* Delete get() and set() types

* Use non-lowercase custom cast class strings

* Check hasCast manually

* Correct encrypted castable logic

* Update src/VirtualColumn.php

* Use `$dataEncoded` bool instead of `$dataEncodingStatus` string

* Don't accept unused `$e`

* Refactor `encodeAttributes()`

* Use `$model->getCustomColumns()` instead of `static::getCustomColumns()`

* Use `$model` instead of `static` where possible

* Correct test

* Revert `static` -> `$model` changes

* Correct typo

* Refactor `$afterListeneres`

* Fix code style (php-cs-fixer)

* Make static things non-static in VirtualColumn

* Change method to non-static in test

* Add base class that uses VirtualColumn in tests

* Add encrypted castables docblock

* Fix merge

* Fix ParentModel change

* make $this and $model use clear and consistent

---------

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2023-11-08 10:08:34 +01:00
lukinovec
925249bb72
Test that child models extending a parent that uses VirtualColumn get encoded correctly (#16)
* Test that using different models extending the same class with VirtualColumn doesn't work correctly

* Add regression test for faulty logic

* Delete unused import

* Add migration

* Fix migrations

* Make the assertions check the intended behavior
2023-11-06 21:46:14 +01:00
lukinovec
0b108903b5
Add L10 support, remove L6 and L8 support (#11)
* Add L10 support

* Update PHP version in ci.yml

* Update ci.yml

* Revert ci.yml changes

* Migrate PHPUnit XML config using "--migrate-configuration"

* Update phpunit.xml (delete cacheDirectory, use backupStaticAttributes instead of backupStaticProperties)

* Delete backupStaticAttributes

* Add PHP version matrix

* Use ci.yml from #12

* Correct Laravel matrix versions

* Revert ci.yml changes

* Use multiple PHP versions

* Update ci.yml

* Don't use PHP 8 with Laravel 10 in CI

* Update ci.yml

* Remove L6 and L8 support

* Use single PHP version in CI

* Update ci.yml

* Change matrix in ci.yml

* swap laravel 9 & 10

* Update README.md

---------

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2023-02-16 11:34:42 +01:00
Samuel Štancl
46c590e240
Add @mixin annotation 2022-11-08 12:35:18 +01:00
Samuel Štancl
ab3f943990
Merge pull request #9 from lukinovec/generate-column-name
Add method for generating the column name
2022-10-21 14:09:30 +02:00
ac0dccc6e7
add docblock 2022-10-21 14:08:35 +02:00
lukinovec
73d7918170 Rename generateColumnName 2022-10-21 13:56:03 +02:00
lukinovec
5881f13b81 Correct comment 2022-10-21 11:51:05 +02:00
lukinovec
c0cd839acc Add test for generating the column name 2022-10-21 11:49:10 +02:00
lukinovec
43f0b2c30f Add method for generating column names 2022-10-21 11:32:12 +02:00
Samuel Štancl
66458d046b
mention Laravel 9 support 2022-07-22 20:17:45 +02:00
Samuel Štancl
dd3a77f17c
Merge pull request #8 from abrardev99/support-l9
Support Laravel 9
2022-01-27 12:08:03 +01:00
Abrar Ahmad
77173d7f03 removed l7 2022-01-27 13:30:34 +05:00
Abrar Ahmad
6dc8467473 wip 2022-01-26 21:54:10 +05:00
Samuel Štancl
c5e70e832c
Merge pull request #7 from stein-j/master
Sync with original attributes
2022-01-04 12:05:03 +01:00
j.stein
9b31176b32 Update VirtualColumnTest.php 2022-01-04 01:23:51 +01:00
j.stein
2ae1ed099f Sync with original attributes 2022-01-04 01:12:11 +01:00
Samuel Štancl
41d300bf7f
Merge pull request #6 from stein-j/patch-1
Typo
2022-01-04 00:36:25 +01:00
Jori Stein
11e678c435
Typo 2022-01-04 00:23:23 +01:00
Samuel Štancl
8c8655b74a
Update composer.json 2021-12-06 16:15:52 +01:00
Samuel Štancl
320d0fc2be
Update README.md 2020-09-08 18:49:58 +02:00
Samuel Štancl
cdec7c6ade
Merge pull request #4 from andresayej/l8-test
First try at Laravel 8 support + more advanced CI
2020-09-08 18:49:16 +02:00
Andre Sayej
76c85704d9
First try at Laravel 8 support + more advanced CI 2020-09-07 13:02:17 +03:00
Samuel Štancl
26471c9ed9
Typo - fix #3 2020-09-02 16:53:27 +02:00
Samuel Stancl
258dfd21f8
Add getCustomColumns() 2020-07-06 16:08:54 +02:00
Samuel Štancl
e41770bf6b model -> trait 2020-07-06 14:25:29 +02:00
Samuel Štancl
1418a51fef Initial commit 2020-07-06 14:25:02 +02:00