diff --git a/app/Http/Transformers/LicenseSeatsTransformer.php b/app/Http/Transformers/LicenseSeatsTransformer.php index 7ae68e9e4..6b83f1292 100644 --- a/app/Http/Transformers/LicenseSeatsTransformer.php +++ b/app/Http/Transformers/LicenseSeatsTransformer.php @@ -2,6 +2,7 @@ namespace App\Http\Transformers; +use App\Helpers\Helper; use App\Models\License; use App\Models\LicenseSeat; use Illuminate\Support\Facades\Gate; @@ -26,6 +27,7 @@ class LicenseSeatsTransformer $array = [ 'id' => (int) $seat->id, 'license_id' => (int) $seat->license->id, + 'updated_at' => Helper::getFormattedDateObject($seat->updated_at, 'datetime'), // we use updated_at here because the record gets updated when it's checked in or out 'assigned_user' => ($seat->user) ? [ 'id' => (int) $seat->user->id, 'name'=> e($seat->user->present()->fullName), @@ -36,14 +38,17 @@ class LicenseSeatsTransformer 'name' => e($seat->user->department->name), ] : null, + 'created_at' => Helper::getFormattedDateObject($seat->created_at, 'datetime'), ] : null, 'assigned_asset' => ($seat->asset) ? [ 'id' => (int) $seat->asset->id, 'name'=> e($seat->asset->present()->fullName), + 'created_at' => Helper::getFormattedDateObject($seat->created_at, 'datetime'), ] : null, 'location' => ($seat->location()) ? [ 'id' => (int) $seat->location()->id, 'name'=> e($seat->location()->name), + 'created_at' => Helper::getFormattedDateObject($seat->created_at, 'datetime'), ] : null, 'reassignable' => (bool) $seat->license->reassignable, 'notes' => e($seat->notes), diff --git a/app/Presenters/LicensePresenter.php b/app/Presenters/LicensePresenter.php index 351a9acea..b0f63acdb 100644 --- a/app/Presenters/LicensePresenter.php +++ b/app/Presenters/LicensePresenter.php @@ -280,6 +280,14 @@ class LicensePresenter extends Presenter 'visible' => true, 'formatter' => 'locationsLinkObjFormatter', ], + [ + 'field' => 'updated_at', + 'searchable' => false, + 'sortable' => true, + 'visible' => false, + 'title' => trans('general.date'), + 'formatter' => 'dateDisplayFormatter', + ], [ 'field' => 'notes', 'searchable' => false, diff --git a/composer.lock b/composer.lock index 63617c5bc..2be240834 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "87742cc73d186f6f47627ad498cf0fe5", + "content-hash": "2e91e2f670634312429f20fda573e6a1", "packages": [ { "name": "alek13/slack", @@ -342,30 +342,30 @@ }, { "name": "barryvdh/laravel-debugbar", - "version": "v3.14.10", + "version": "v3.15.4", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-debugbar.git", - "reference": "56b9bd235e3fe62e250124804009ce5bab97cc63" + "reference": "c0667ea91f7185f1e074402c5788195e96bf8106" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/56b9bd235e3fe62e250124804009ce5bab97cc63", - "reference": "56b9bd235e3fe62e250124804009ce5bab97cc63", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/c0667ea91f7185f1e074402c5788195e96bf8106", + "reference": "c0667ea91f7185f1e074402c5788195e96bf8106", "shasum": "" }, "require": { - "illuminate/routing": "^9|^10|^11", - "illuminate/session": "^9|^10|^11", - "illuminate/support": "^9|^10|^11", - "maximebf/debugbar": "~1.23.0", - "php": "^8.0", + "illuminate/routing": "^9|^10|^11|^12", + "illuminate/session": "^9|^10|^11|^12", + "illuminate/support": "^9|^10|^11|^12", + "php": "^8.1", + "php-debugbar/php-debugbar": "~2.1.1", "symfony/finder": "^6|^7" }, "require-dev": { "mockery/mockery": "^1.3.3", - "orchestra/testbench-dusk": "^5|^6|^7|^8|^9", - "phpunit/phpunit": "^9.6|^10.5", + "orchestra/testbench-dusk": "^7|^8|^9|^10", + "phpunit/phpunit": "^9.5.10|^10|^11", "squizlabs/php_codesniffer": "^3.5" }, "type": "library", @@ -379,7 +379,7 @@ ] }, "branch-alias": { - "dev-master": "3.14-dev" + "dev-master": "3.15-dev" } }, "autoload": { @@ -404,13 +404,14 @@ "keywords": [ "debug", "debugbar", + "dev", "laravel", "profiler", "webprofiler" ], "support": { "issues": "https://github.com/barryvdh/laravel-debugbar/issues", - "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.14.10" + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.15.4" }, "funding": [ { @@ -422,7 +423,7 @@ "type": "github" } ], - "time": "2024-12-23T10:10:42+00:00" + "time": "2025-04-16T06:32:06+00:00" }, { "name": "barryvdh/laravel-dompdf", @@ -4609,74 +4610,6 @@ }, "time": "2024-03-31T07:05:07+00:00" }, - { - "name": "maximebf/debugbar", - "version": "v1.23.5", - "source": { - "type": "git", - "url": "https://github.com/php-debugbar/php-debugbar.git", - "reference": "eeabd61a1f19ba5dcd5ac4585a477130ee03ce25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/eeabd61a1f19ba5dcd5ac4585a477130ee03ce25", - "reference": "eeabd61a1f19ba5dcd5ac4585a477130ee03ce25", - "shasum": "" - }, - "require": { - "php": "^7.2|^8", - "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^4|^5|^6|^7" - }, - "require-dev": { - "dbrekelmans/bdi": "^1", - "phpunit/phpunit": "^8|^9", - "symfony/panther": "^1|^2.1", - "twig/twig": "^1.38|^2.7|^3.0" - }, - "suggest": { - "kriswallsmith/assetic": "The best way to manage assets", - "monolog/monolog": "Log using Monolog", - "predis/predis": "Redis storage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.23-dev" - } - }, - "autoload": { - "psr-4": { - "DebugBar\\": "src/DebugBar/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Maxime Bouroumeau-Fuseau", - "email": "maxime.bouroumeau@gmail.com", - "homepage": "http://maximebf.com" - }, - { - "name": "Barry vd. Heuvel", - "email": "barryvdh@gmail.com" - } - ], - "description": "Debug bar in the browser for php application", - "homepage": "https://github.com/maximebf/php-debugbar", - "keywords": [ - "debug", - "debugbar" - ], - "support": { - "issues": "https://github.com/php-debugbar/php-debugbar/issues", - "source": "https://github.com/php-debugbar/php-debugbar/tree/v1.23.5" - }, - "time": "2024-12-15T19:20:42+00:00" - }, { "name": "monolog/monolog", "version": "3.9.0", @@ -6004,6 +5937,76 @@ }, "time": "2024-04-08T12:52:34+00:00" }, + { + "name": "php-debugbar/php-debugbar", + "version": "v2.1.6", + "source": { + "type": "git", + "url": "https://github.com/php-debugbar/php-debugbar.git", + "reference": "16fa68da5617220594aa5e33fa9de415f94784a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/16fa68da5617220594aa5e33fa9de415f94784a0", + "reference": "16fa68da5617220594aa5e33fa9de415f94784a0", + "shasum": "" + }, + "require": { + "php": "^8", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^4|^5|^6|^7" + }, + "require-dev": { + "dbrekelmans/bdi": "^1", + "phpunit/phpunit": "^8|^9", + "symfony/panther": "^1|^2.1", + "twig/twig": "^1.38|^2.7|^3.0" + }, + "suggest": { + "kriswallsmith/assetic": "The best way to manage assets", + "monolog/monolog": "Log using Monolog", + "predis/predis": "Redis storage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "DebugBar\\": "src/DebugBar/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maxime Bouroumeau-Fuseau", + "email": "maxime.bouroumeau@gmail.com", + "homepage": "http://maximebf.com" + }, + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Debug bar in the browser for php application", + "homepage": "https://github.com/php-debugbar/php-debugbar", + "keywords": [ + "debug", + "debug bar", + "debugbar", + "dev" + ], + "support": { + "issues": "https://github.com/php-debugbar/php-debugbar/issues", + "source": "https://github.com/php-debugbar/php-debugbar/tree/v2.1.6" + }, + "time": "2025-02-21T17:47:03+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", diff --git a/tests/Feature/Importing/Api/ImportAssetModelsTest.php b/tests/Feature/Importing/Api/ImportAssetModelsTest.php index f1af2ad34..a3a0a9ca4 100644 --- a/tests/Feature/Importing/Api/ImportAssetModelsTest.php +++ b/tests/Feature/Importing/Api/ImportAssetModelsTest.php @@ -132,8 +132,8 @@ class ImportAssetModelsTest extends ImportDataTestCase implements TestsPermissio $this->assertEquals($row['model_number'], $updatedAssetmodel->model_number); $this->assertEquals( - Arr::except($assetmodel->attributesToArray(), $updatedAttributes), - Arr::except($updatedAssetmodel->attributesToArray(), $updatedAttributes), + Arr::except($assetmodel->attributesToArray(), array_merge($updatedAttributes, $assetmodel->getDates())), + Arr::except($updatedAssetmodel->attributesToArray(), array_merge($updatedAttributes, $assetmodel->getDates())), ); }