diff --git a/composer.lock b/composer.lock index 18cc7d39..8231d7f9 100644 --- a/composer.lock +++ b/composer.lock @@ -8,21 +8,21 @@ "packages": [ { "name": "anourvalar/eloquent-serialize", - "version": "1.2.18", + "version": "1.2.19", "source": { "type": "git", "url": "https://github.com/AnourValar/eloquent-serialize.git", - "reference": "ea37278f305215bb763d8e901cd8fd448462a8af" + "reference": "7ab1be9b9d9a2369643b5e58796cd43717b9b5c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AnourValar/eloquent-serialize/zipball/ea37278f305215bb763d8e901cd8fd448462a8af", - "reference": "ea37278f305215bb763d8e901cd8fd448462a8af", + "url": "https://api.github.com/repos/AnourValar/eloquent-serialize/zipball/7ab1be9b9d9a2369643b5e58796cd43717b9b5c3", + "reference": "7ab1be9b9d9a2369643b5e58796cd43717b9b5c3", "shasum": "" }, "require": { "laravel/framework": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", - "php": "^7.1|^8.0" + "php": "^7.4|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.26", @@ -68,9 +68,9 @@ ], "support": { "issues": "https://github.com/AnourValar/eloquent-serialize/issues", - "source": "https://github.com/AnourValar/eloquent-serialize/tree/1.2.18" + "source": "https://github.com/AnourValar/eloquent-serialize/tree/1.2.19" }, - "time": "2024-02-25T11:04:10+00:00" + "time": "2024-03-03T05:05:13+00:00" }, { "name": "awcodes/filament-tiptap-editor", @@ -609,6 +609,350 @@ }, "time": "2022-10-27T11:44:00+00:00" }, + { + "name": "doctrine/cache", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:07:39+00:00" + }, + { + "name": "doctrine/dbal", + "version": "3.8.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/db922ba9436b7b18a23d1653a0b41ff2369ca41c", + "reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.58", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.16", + "psalm/plugin-phpunit": "0.18.4", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.9.0", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^4.4|^5.4|^6.0|^7.0", + "vimeo/psalm": "4.30.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.8.3" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "time": "2024-03-03T15:55:06+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/750671534e0241a7c50ea5b43f67e23eb5c96f32", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.28" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2022-10-12T20:59:15+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.10", @@ -907,16 +1251,16 @@ }, { "name": "filament/actions", - "version": "v3.2.40", + "version": "v3.2.43", "source": { "type": "git", "url": "https://github.com/filamentphp/actions.git", - "reference": "dc87d0954eb05e04ffd7c94c2fec624fc0fb8cb5" + "reference": "7e7bd61e30504cd69d3f0a1127459feb30b3e6e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/actions/zipball/dc87d0954eb05e04ffd7c94c2fec624fc0fb8cb5", - "reference": "dc87d0954eb05e04ffd7c94c2fec624fc0fb8cb5", + "url": "https://api.github.com/repos/filamentphp/actions/zipball/7e7bd61e30504cd69d3f0a1127459feb30b3e6e0", + "reference": "7e7bd61e30504cd69d3f0a1127459feb30b3e6e0", "shasum": "" }, "require": { @@ -956,20 +1300,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-02-27T15:32:43+00:00" + "time": "2024-03-01T12:23:55+00:00" }, { "name": "filament/filament", - "version": "v3.2.40", + "version": "v3.2.43", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "777d69a9942ec2130afaee189819785b2b77a1f1" + "reference": "a091223785678e326ee89e9f194d774c288e26da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/777d69a9942ec2130afaee189819785b2b77a1f1", - "reference": "777d69a9942ec2130afaee189819785b2b77a1f1", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/a091223785678e326ee89e9f194d774c288e26da", + "reference": "a091223785678e326ee89e9f194d774c288e26da", "shasum": "" }, "require": { @@ -1021,20 +1365,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-02-28T12:18:17+00:00" + "time": "2024-03-04T12:09:43+00:00" }, { "name": "filament/forms", - "version": "v3.2.40", + "version": "v3.2.43", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "cb06d6e6f26d7b1837825fce3a4e77764fd346ad" + "reference": "64c3d18ca2c7794d96f113d3c5b11f6eccef30e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/cb06d6e6f26d7b1837825fce3a4e77764fd346ad", - "reference": "cb06d6e6f26d7b1837825fce3a4e77764fd346ad", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/64c3d18ca2c7794d96f113d3c5b11f6eccef30e7", + "reference": "64c3d18ca2c7794d96f113d3c5b11f6eccef30e7", "shasum": "" }, "require": { @@ -1077,20 +1421,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-02-27T15:32:42+00:00" + "time": "2024-03-04T12:09:41+00:00" }, { "name": "filament/infolists", - "version": "v3.2.40", + "version": "v3.2.43", "source": { "type": "git", "url": "https://github.com/filamentphp/infolists.git", - "reference": "9c5748d4c5278c7854c53f283e16585002006920" + "reference": "9d13f101531ef920961967f1e4501540a22e1659" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/infolists/zipball/9c5748d4c5278c7854c53f283e16585002006920", - "reference": "9c5748d4c5278c7854c53f283e16585002006920", + "url": "https://api.github.com/repos/filamentphp/infolists/zipball/9d13f101531ef920961967f1e4501540a22e1659", + "reference": "9d13f101531ef920961967f1e4501540a22e1659", "shasum": "" }, "require": { @@ -1128,20 +1472,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-02-27T15:32:44+00:00" + "time": "2024-03-04T12:09:37+00:00" }, { "name": "filament/notifications", - "version": "v3.2.40", + "version": "v3.2.43", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", - "reference": "e6809dd500ce6b061c3bfb7d19dc03248572611e" + "reference": "93c1d72b12ff1bed520d082a1292ab25a566a8d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/notifications/zipball/e6809dd500ce6b061c3bfb7d19dc03248572611e", - "reference": "e6809dd500ce6b061c3bfb7d19dc03248572611e", + "url": "https://api.github.com/repos/filamentphp/notifications/zipball/93c1d72b12ff1bed520d082a1292ab25a566a8d8", + "reference": "93c1d72b12ff1bed520d082a1292ab25a566a8d8", "shasum": "" }, "require": { @@ -1180,24 +1524,25 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-02-27T15:32:43+00:00" + "time": "2024-02-29T12:30:04+00:00" }, { "name": "filament/support", - "version": "v3.2.40", + "version": "v3.2.43", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "c3788e1f63ffb9e15ed6e584c750c20a26720768" + "reference": "6dcf24890fdf69ffeb2d49f29a8a4c51cf7d4fc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/c3788e1f63ffb9e15ed6e584c750c20a26720768", - "reference": "c3788e1f63ffb9e15ed6e584c750c20a26720768", + "url": "https://api.github.com/repos/filamentphp/support/zipball/6dcf24890fdf69ffeb2d49f29a8a4c51cf7d4fc3", + "reference": "6dcf24890fdf69ffeb2d49f29a8a4c51cf7d4fc3", "shasum": "" }, "require": { "blade-ui-kit/blade-heroicons": "^2.2.1", + "doctrine/dbal": "^3.2", "ext-intl": "*", "illuminate/contracts": "^10.45|^11.0", "illuminate/support": "^10.45|^11.0", @@ -1236,20 +1581,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-02-28T12:18:32+00:00" + "time": "2024-03-04T12:09:59+00:00" }, { "name": "filament/tables", - "version": "v3.2.40", + "version": "v3.2.43", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "86e5a1c1021b732049ff7a0eb7abf02c40708d9d" + "reference": "081e59d82e463cea72f8c52579ceecc3b22937ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/86e5a1c1021b732049ff7a0eb7abf02c40708d9d", - "reference": "86e5a1c1021b732049ff7a0eb7abf02c40708d9d", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/081e59d82e463cea72f8c52579ceecc3b22937ca", + "reference": "081e59d82e463cea72f8c52579ceecc3b22937ca", "shasum": "" }, "require": { @@ -1289,20 +1634,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-02-28T12:18:23+00:00" + "time": "2024-03-04T12:10:08+00:00" }, { "name": "filament/widgets", - "version": "v3.2.40", + "version": "v3.2.43", "source": { "type": "git", "url": "https://github.com/filamentphp/widgets.git", - "reference": "3aa945b635745c5731a9728134411d500cf3a30a" + "reference": "fe151db7d32f1f85117a5be46b3fedd8ebb6380b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/widgets/zipball/3aa945b635745c5731a9728134411d500cf3a30a", - "reference": "3aa945b635745c5731a9728134411d500cf3a30a", + "url": "https://api.github.com/repos/filamentphp/widgets/zipball/fe151db7d32f1f85117a5be46b3fedd8ebb6380b", + "reference": "fe151db7d32f1f85117a5be46b3fedd8ebb6380b", "shasum": "" }, "require": { @@ -1333,7 +1678,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-02-01T11:30:24+00:00" + "time": "2024-03-04T12:10:03+00:00" }, { "name": "fruitcake/php-cors", @@ -3670,6 +4015,55 @@ ], "time": "2023-11-12T21:59:55+00:00" }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, { "name": "psr/clock", "version": "1.0.0", @@ -5359,16 +5753,16 @@ }, { "name": "symfony/http-kernel", - "version": "v6.4.4", + "version": "v6.4.5", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "7a186f64a7f02787c04e8476538624d6aa888e42" + "reference": "f6947cb939d8efee137797382cb4db1af653ef75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/7a186f64a7f02787c04e8476538624d6aa888e42", - "reference": "7a186f64a7f02787c04e8476538624d6aa888e42", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f6947cb939d8efee137797382cb4db1af653ef75", + "reference": "f6947cb939d8efee137797382cb4db1af653ef75", "shasum": "" }, "require": { @@ -5452,7 +5846,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.4" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.5" }, "funding": [ { @@ -5468,7 +5862,7 @@ "type": "tidelift" } ], - "time": "2024-02-27T06:32:13+00:00" + "time": "2024-03-04T21:00:47+00:00" }, { "name": "symfony/mailer", @@ -6408,16 +6802,16 @@ }, { "name": "symfony/routing", - "version": "v6.4.3", + "version": "v6.4.5", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842" + "reference": "7fe30068e207d9c31c0138501ab40358eb2d49a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/3b2957ad54902f0f544df83e3d58b38d7e8e5842", - "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842", + "url": "https://api.github.com/repos/symfony/routing/zipball/7fe30068e207d9c31c0138501ab40358eb2d49a4", + "reference": "7fe30068e207d9c31c0138501ab40358eb2d49a4", "shasum": "" }, "require": { @@ -6471,7 +6865,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.3" + "source": "https://github.com/symfony/routing/tree/v6.4.5" }, "funding": [ { @@ -6487,7 +6881,7 @@ "type": "tidelift" } ], - "time": "2024-01-30T13:55:02+00:00" + "time": "2024-02-27T12:33:30+00:00" }, { "name": "symfony/service-contracts", @@ -7777,16 +8171,16 @@ }, { "name": "larastan/larastan", - "version": "v2.9.1", + "version": "v2.9.2", "source": { "type": "git", "url": "https://github.com/larastan/larastan.git", - "reference": "467113c58d110ad617cf9e07ff49b0948d1c03cc" + "reference": "a79b46b96060504b400890674b83f66aa7f5db6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/467113c58d110ad617cf9e07ff49b0948d1c03cc", - "reference": "467113c58d110ad617cf9e07ff49b0948d1c03cc", + "url": "https://api.github.com/repos/larastan/larastan/zipball/a79b46b96060504b400890674b83f66aa7f5db6d", + "reference": "a79b46b96060504b400890674b83f66aa7f5db6d", "shasum": "" }, "require": { @@ -7803,6 +8197,7 @@ "phpstan/phpstan": "^1.10.50" }, "require-dev": { + "doctrine/coding-standard": "^12.0", "nikic/php-parser": "^4.17.1", "orchestra/canvas": "^7.11.1 || ^8.11.0 || ^9.0.0", "orchestra/testbench": "^7.33.0 || ^8.13.0 || ^9.0.0", @@ -7854,7 +8249,7 @@ ], "support": { "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v2.9.1" + "source": "https://github.com/larastan/larastan/tree/v2.9.2" }, "funding": [ { @@ -7874,7 +8269,7 @@ "type": "patreon" } ], - "time": "2024-02-26T14:10:20+00:00" + "time": "2024-02-27T03:16:03+00:00" }, { "name": "laravel/legacy-factories", @@ -8722,16 +9117,16 @@ }, { "name": "orchestra/workbench", - "version": "v8.2.1", + "version": "v8.3.0", "source": { "type": "git", "url": "https://github.com/orchestral/workbench.git", - "reference": "e8e6e4dcf6fb26ea1924c3581e49aa347691a8ea" + "reference": "1246c7ffd0ab8b1cbf9a9b346a50921dd83bc24b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/workbench/zipball/e8e6e4dcf6fb26ea1924c3581e49aa347691a8ea", - "reference": "e8e6e4dcf6fb26ea1924c3581e49aa347691a8ea", + "url": "https://api.github.com/repos/orchestral/workbench/zipball/1246c7ffd0ab8b1cbf9a9b346a50921dd83bc24b", + "reference": "1246c7ffd0ab8b1cbf9a9b346a50921dd83bc24b", "shasum": "" }, "require": { @@ -8740,7 +9135,7 @@ "laravel/framework": "^10.38.1", "laravel/tinker": "^2.8.2", "orchestra/canvas": "^8.11.4", - "orchestra/testbench-core": "^8.17", + "orchestra/testbench-core": "^8.22", "php": "^8.1", "spatie/laravel-ray": "^1.32.4", "symfony/polyfill-php83": "^1.28", @@ -8786,26 +9181,27 @@ ], "support": { "issues": "https://github.com/orchestral/workbench/issues", - "source": "https://github.com/orchestral/workbench/tree/v8.2.1" + "source": "https://github.com/orchestral/workbench/tree/v8.3.0" }, - "time": "2023-12-28T15:15:44+00:00" + "time": "2024-03-03T14:32:38+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -8846,9 +9242,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -9053,16 +9455,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.11", + "version": "10.1.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145" + "reference": "842f72662d6b9edda84c4b6f13885fd9cd53dc63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/842f72662d6b9edda84c4b6f13885fd9cd53dc63", + "reference": "842f72662d6b9edda84c4b6f13885fd9cd53dc63", "shasum": "" }, "require": { @@ -9119,7 +9521,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.11" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.12" }, "funding": [ { @@ -9127,7 +9529,7 @@ "type": "github" } ], - "time": "2023-12-21T15:38:30+00:00" + "time": "2024-03-02T07:22:05+00:00" }, { "name": "phpunit/php-file-iterator", @@ -9651,16 +10053,16 @@ }, { "name": "rector/rector", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "258b775511e62a7188f8ce114d44acaf244d9a7d" + "reference": "7596fa6da06c6a20c012efe6bb3d9188a9113b11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/258b775511e62a7188f8ce114d44acaf244d9a7d", - "reference": "258b775511e62a7188f8ce114d44acaf244d9a7d", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/7596fa6da06c6a20c012efe6bb3d9188a9113b11", + "reference": "7596fa6da06c6a20c012efe6bb3d9188a9113b11", "shasum": "" }, "require": { @@ -9695,7 +10097,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/1.0.1" + "source": "https://github.com/rectorphp/rector/tree/1.0.2" }, "funding": [ { @@ -9703,20 +10105,20 @@ "type": "github" } ], - "time": "2024-02-16T07:53:23+00:00" + "time": "2024-03-03T12:32:31+00:00" }, { "name": "sebastian/cli-parser", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { @@ -9751,7 +10153,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -9759,7 +10162,7 @@ "type": "github" } ], - "time": "2023-02-03T06:58:15+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", @@ -10009,16 +10412,16 @@ }, { "name": "sebastian/diff", - "version": "5.1.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { @@ -10026,7 +10429,7 @@ }, "require-dev": { "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" + "symfony/process": "^6.4" }, "type": "library", "extra": { @@ -10064,7 +10467,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -10072,7 +10475,7 @@ "type": "github" } ], - "time": "2023-12-22T10:55:06+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", @@ -10140,16 +10543,16 @@ }, { "name": "sebastian/exporter", - "version": "5.1.1", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { @@ -10206,7 +10609,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -10214,20 +10617,20 @@ "type": "github" } ], - "time": "2023-09-24T13:22:09+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { @@ -10261,14 +10664,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -10276,7 +10679,7 @@ "type": "github" } ], - "time": "2023-07-19T07:19:23+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", @@ -11195,16 +11598,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -11233,7 +11636,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -11241,7 +11644,7 @@ "type": "github" } ], - "time": "2023-11-20T00:12:19+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "zbateson/mail-mime-parser", diff --git a/phpunit.xml b/phpunit.xml index 3b1c4e15..acab9317 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,13 +7,18 @@ tests/Feature/InstallTest.php - + tests/Feature/TaxonomyTest.php tests/Filament/AuthorResourceTest.php + tests/Filament/PageResourceTest.php + tests/Filament/PermissionResourceTest.php + tests/Filament/RoleResourceTest.php + tests/Filament/TaxonomyResourceTest.php + tests/Filament/UserResourceTest.php diff --git a/src/Filament/Resources/UserResource.php b/src/Filament/Resources/UserResource.php index 46e3eb4d..544ba05c 100644 --- a/src/Filament/Resources/UserResource.php +++ b/src/Filament/Resources/UserResource.php @@ -2,7 +2,6 @@ namespace Portable\FilaCms\Filament\Resources; -use App\Models\User; use Filament\Forms\Form; use Filament\Tables; use Filament\Tables\Table; @@ -13,7 +12,7 @@ class UserResource extends AbstractConfigurableResource { use IsProtectedResource; - protected static ?string $model = User::class; + protected static ?string $model = null; protected static string $configKey = 'fila-cms.users'; @@ -31,6 +30,7 @@ public static function form(Form $form): Form public static function table(Table $table): Table { + static::$model = config('auth.providers.users.model'); return $table ->columns(static::getTableColumns()) ->filters([ diff --git a/src/Models/AbstractContentResource.php b/src/Models/AbstractContentResource.php index 5395ff13..f1a22644 100644 --- a/src/Models/AbstractContentResource.php +++ b/src/Models/AbstractContentResource.php @@ -59,12 +59,12 @@ public function author() public function createdBy() { - return $this->belongsTo(User::class, 'created_user_id'); + return $this->belongsTo(config('auth.providers.users.model'), 'created_user_id'); } public function updatedBy() { - return $this->belongsTo(User::class, 'updated_user_id'); + return $this->belongsTo(config('auth.providers.users.model'), 'updated_user_id'); } protected function status(): Attribute diff --git a/testbench.yaml b/testbench.yaml index 342500d4..c84747d0 100644 --- a/testbench.yaml +++ b/testbench.yaml @@ -22,6 +22,7 @@ migrations: seeders: - Workbench\Database\Seeders\DatabaseSeeder + workbench: start: "/" install: true diff --git a/tests/Filament/AuthorResourceTest.php b/tests/Filament/AuthorResourceTest.php index b675a73a..a65f5127 100644 --- a/tests/Filament/AuthorResourceTest.php +++ b/tests/Filament/AuthorResourceTest.php @@ -37,168 +37,168 @@ public function test_render_page(): void $this->get(TargetResource::getUrl('index'))->assertSuccessful(); } - // public function test_forbidden(): void - // { - // $user = config('auth.providers.users.model')::factory()->create(); - // $this->be($user); - // $this->get(TargetResource::getUrl('index'))->assertForbidden(); - // } - - // public function test_can_list_data(): void - // { - // $data = []; - // for ($i = 0; $i < 5; $i++) { - // $data[] = $this->generateModel(); - // } - - // Livewire::test(TargetResource\Pages\ListAuthors::class)->assertCanSeeTableRecords($data); - // } - - // public function test_can_create_record(): void - // { - // Livewire::test(TargetResource\Pages\CreateAuthor::class) - // ->fillForm([ - // 'first_name' => $this->faker->firstName, - // 'last_name' => $this->faker->lastName, - // 'is_individual' => $this->faker->numberBetween(0, 1) - // ]) - // ->call('create') - // ->assertHasNoFormErrors(); - - // Livewire::test(TargetResource\Pages\CreateAuthor::class) - // ->fillForm([ - // 'first_name' => '', - // 'last_name' => '', - // ]) - // ->call('create') - // ->assertHasFormErrors([ - // 'first_name' => 'required', - // ]); - // } - - // public function test_can_render_edit_page(): void - // { - // $this->generateModel(); - - // $data = TargetModel::first(); - - // $this->get(TargetResource::getUrl('edit', ['record' => $data]))->assertSuccessful(); - // } - - // public function test_can_retrieve_edit_data(): void - // { - // $this->generateModel(); - // $data = TargetModel::first(); - - // Livewire::test( - // TargetResource\Pages\EditAuthor::class, - // ['record' => $data->getRouteKey()] - // ) - // ->assertFormSet([ - // 'first_name' => $data->first_name, - // 'last_name' => $data->last_name, - // 'is_individual' => $data->is_individual, - // ]); - // } - - // public function test_can_save_form(): void - // { - // $data = $this->generateModel(); - - // $new = TargetModel::make([ - // 'first_name' => $this->faker->firstName, - // 'last_name' => $this->faker->lastName, - // 'is_individual' => $this->faker->numberBetween(0, 1) - // ]); - - // $updatedTime = now(); - // Livewire::test(TargetResource\Pages\EditAuthor::class, [ - // 'record' => $data->getRoutekey(), - // ]) - // ->fillForm([ - // 'first_name' => $new->first_name, - // 'last_name' => $new->last_name, - // 'is_individual' => $new->is_individual, - // ]) - // ->call('save') - // ->assertHasNoFormErrors(); - - // $data->refresh(); - // $this->assertEquals($data->first_name, $new->first_name); - // $this->assertEquals($data->is_individual, $new->is_individual); - // $this->assertEquals($data->updated_at->format('Y-m-d H:i'), $updatedTime->format('Y-m-d H:i')); - // } - - // public function test_display_name_individual_to_company(): void - // { - // $data = TargetModel::create([ - // 'first_name' => $this->faker->firstName, - // 'last_name' => $this->faker->lastName, - // 'is_individual' => 1 - // ]); - - // $new = TargetModel::make([ - // 'first_name' => $this->faker->firstName, - // 'last_name' => '', - // 'is_individual' => 0 - // ]); - - // $updatedTime = now(); - // Livewire::test(TargetResource\Pages\EditAuthor::class, [ - // 'record' => $data->getRoutekey(), - // ]) - // ->fillForm([ - // 'first_name' => $new->first_name, - // 'last_name' => $new->last_name, - // 'is_individual' => $new->is_individual, - // ]) - // ->call('save') - // ->assertHasNoFormErrors(); - - // $data->refresh(); - // $this->assertEquals($data->display_name, $new->first_name); - // $this->assertEquals($data->is_individual, $new->is_individual); - // $this->assertEquals($data->updated_at->format('Y-m-d H:i'), $updatedTime->format('Y-m-d H:i')); - // } - - // public function test_display_name_company_to_individual(): void - // { - // $data = TargetModel::create([ - // 'first_name' => $this->faker->firstName, - // 'last_name' => '', - // 'is_individual' => 0, - // ]); - - // $new = TargetModel::make([ - // 'first_name' => $this->faker->firstName, - // 'last_name' => $this->faker->lastName, - // 'is_individual' => 1 - // ]); - - // $updatedTime = now(); - // Livewire::test(TargetResource\Pages\EditAuthor::class, [ - // 'record' => $data->getRoutekey(), - // ]) - // ->fillForm([ - // 'first_name' => $new->first_name, - // 'last_name' => $new->last_name, - // 'is_individual' => $new->is_individual, - // ]) - // ->call('save') - // ->assertHasNoFormErrors(); - - // $data->refresh(); - // $this->assertEquals($data->display_name, $new->first_name . ' ' . $new->last_name); - // $this->assertEquals($data->is_individual, $new->is_individual); - // $this->assertEquals($data->updated_at->format('Y-m-d H:i'), $updatedTime->format('Y-m-d H:i')); - // } - - // public function generateModel(): TargetModel - // { - // return TargetModel::create([ - // 'first_name' => $this->faker->firstName, - // 'last_name' => $this->faker->lastName, - // 'is_individual' => $this->faker->numberBetween(0, 1) - // ]); - // } + public function test_forbidden(): void + { + $user = $this->createUser(); + $this->be($user); + $this->get(TargetResource::getUrl('index'))->assertForbidden(); + } + + public function test_can_list_data(): void + { + $data = []; + for ($i = 0; $i < 5; $i++) { + $data[] = $this->generateModel(); + } + + Livewire::test(TargetResource\Pages\ListAuthors::class)->assertCanSeeTableRecords($data); + } + + public function test_can_create_record(): void + { + Livewire::test(TargetResource\Pages\CreateAuthor::class) + ->fillForm([ + 'first_name' => $this->faker->firstName, + 'last_name' => $this->faker->lastName, + 'is_individual' => $this->faker->numberBetween(0, 1) + ]) + ->call('create') + ->assertHasNoFormErrors(); + + Livewire::test(TargetResource\Pages\CreateAuthor::class) + ->fillForm([ + 'first_name' => '', + 'last_name' => '', + ]) + ->call('create') + ->assertHasFormErrors([ + 'first_name' => 'required', + ]); + } + + public function test_can_render_edit_page(): void + { + $this->generateModel(); + + $data = TargetModel::first(); + + $this->get(TargetResource::getUrl('edit', ['record' => $data]))->assertSuccessful(); + } + + public function test_can_retrieve_edit_data(): void + { + $this->generateModel(); + $data = TargetModel::first(); + + Livewire::test( + TargetResource\Pages\EditAuthor::class, + ['record' => $data->getRouteKey()] + ) + ->assertFormSet([ + 'first_name' => $data->first_name, + 'last_name' => $data->last_name, + 'is_individual' => $data->is_individual, + ]); + } + + public function test_can_save_form(): void + { + $data = $this->generateModel(); + + $new = TargetModel::make([ + 'first_name' => $this->faker->firstName, + 'last_name' => $this->faker->lastName, + 'is_individual' => $this->faker->numberBetween(0, 1) + ]); + + $updatedTime = now(); + Livewire::test(TargetResource\Pages\EditAuthor::class, [ + 'record' => $data->getRoutekey(), + ]) + ->fillForm([ + 'first_name' => $new->first_name, + 'last_name' => $new->last_name, + 'is_individual' => $new->is_individual, + ]) + ->call('save') + ->assertHasNoFormErrors(); + + $data->refresh(); + $this->assertEquals($data->first_name, $new->first_name); + $this->assertEquals($data->is_individual, $new->is_individual); + $this->assertEquals($data->updated_at->format('Y-m-d H:i'), $updatedTime->format('Y-m-d H:i')); + } + + public function test_display_name_individual_to_company(): void + { + $data = TargetModel::create([ + 'first_name' => $this->faker->firstName, + 'last_name' => $this->faker->lastName, + 'is_individual' => 1 + ]); + + $new = TargetModel::make([ + 'first_name' => $this->faker->firstName, + 'last_name' => '', + 'is_individual' => 0 + ]); + + $updatedTime = now(); + Livewire::test(TargetResource\Pages\EditAuthor::class, [ + 'record' => $data->getRoutekey(), + ]) + ->fillForm([ + 'first_name' => $new->first_name, + 'last_name' => $new->last_name, + 'is_individual' => $new->is_individual, + ]) + ->call('save') + ->assertHasNoFormErrors(); + + $data->refresh(); + $this->assertEquals($data->display_name, $new->first_name); + $this->assertEquals($data->is_individual, $new->is_individual); + $this->assertEquals($data->updated_at->format('Y-m-d H:i'), $updatedTime->format('Y-m-d H:i')); + } + + public function test_display_name_company_to_individual(): void + { + $data = TargetModel::create([ + 'first_name' => $this->faker->firstName, + 'last_name' => '', + 'is_individual' => 0, + ]); + + $new = TargetModel::make([ + 'first_name' => $this->faker->firstName, + 'last_name' => $this->faker->lastName, + 'is_individual' => 1 + ]); + + Livewire::test(TargetResource\Pages\EditAuthor::class, [ + 'record' => $data->getRoutekey(), + ]) + ->fillForm([ + 'first_name' => $new->first_name, + 'last_name' => $new->last_name, + 'is_individual' => $new->is_individual, + ]) + ->call('save') + ->assertHasNoFormErrors(); + $updatedTime = now(); + + $data->refresh(); + $this->assertEquals($data->display_name, $new->first_name . ' ' . $new->last_name); + $this->assertEquals($data->is_individual, $new->is_individual); + $this->assertEquals($data->updated_at->format('Y-m-d H:i'), $updatedTime->format('Y-m-d H:i')); + } + + public function generateModel(): TargetModel + { + return TargetModel::create([ + 'first_name' => $this->faker->firstName, + 'last_name' => $this->faker->lastName, + 'is_individual' => $this->faker->numberBetween(0, 1) + ]); + } } diff --git a/tests/Filament/PageResourceTest.php b/tests/Filament/PageResourceTest.php index 1a9ebd86..b4e117c4 100644 --- a/tests/Filament/PageResourceTest.php +++ b/tests/Filament/PageResourceTest.php @@ -25,7 +25,7 @@ protected function setUp(): void $this->artisan('db:seed', ['--class' => '\\Portable\\FilaCms\\Database\\Seeders\\RoleAndPermissionSeeder']); $adminRole = Role::where('name', 'Admin')->first(); - $adminUser = User::factory()->create(); + $adminUser = $this->createUser(); $adminUser->assignRole($adminRole); $this->author = Author::create([ @@ -44,7 +44,7 @@ public function test_render_page(): void public function test_forbidden(): void { - $user = User::factory()->create(); + $user = $this->createUser(); $this->be($user); $this->get(TargetResource::getUrl('index'))->assertForbidden(); } @@ -101,7 +101,6 @@ public function test_can_save_form(): void $new = TargetModel::make($this->generateModel(true)); - $updatedTime = now(); Livewire::test(TargetResource\Pages\EditPage::class, [ 'record' => $data->getRoutekey(), ]) @@ -113,6 +112,7 @@ public function test_can_save_form(): void ]) ->call('save') ->assertHasNoFormErrors(); + $updatedTime = now(); $data->refresh(); $this->assertEquals($data->title, $new->title); diff --git a/tests/Filament/PermissionResourceTest.php b/tests/Filament/PermissionResourceTest.php index dfd141fd..3f49fa81 100644 --- a/tests/Filament/PermissionResourceTest.php +++ b/tests/Filament/PermissionResourceTest.php @@ -22,7 +22,7 @@ protected function setUp(): void $this->artisan('db:seed', ['--class' => '\\Portable\\FilaCms\\Database\\Seeders\\RoleAndPermissionSeeder']); $adminRole = Role::where('name', 'Admin')->first(); - $adminUser = User::factory()->create(); + $adminUser = $this->createUser(); $adminUser->assignRole($adminRole); $this->actingAs($adminUser); @@ -35,7 +35,7 @@ public function test_render_page(): void public function test_forbidden(): void { - $user = User::factory()->create(); + $user = $this->createUser(); $this->be($user); $this->get(TargetResource::getUrl('index'))->assertForbidden(); } @@ -89,7 +89,6 @@ public function test_can_save_form(): void $data = TargetModel::create(['name' => $this->faker->words(3, true)]); $new = TargetModel::make(['name' => $this->faker->words(3, true)]); - $updatedTime = now(); Livewire::test(TargetResource\Pages\EditPermission::class, [ 'record' => $data->getRoutekey(), ]) @@ -98,6 +97,7 @@ public function test_can_save_form(): void ]) ->call('save') ->assertHasNoFormErrors(); + $updatedTime = now(); $data->refresh(); $this->assertEquals($data->name, $new->name); diff --git a/tests/Filament/RoleResourceTest.php b/tests/Filament/RoleResourceTest.php index caeeff46..7197b3e5 100644 --- a/tests/Filament/RoleResourceTest.php +++ b/tests/Filament/RoleResourceTest.php @@ -22,7 +22,7 @@ protected function setUp(): void $this->artisan('db:seed', ['--class' => '\\Portable\\FilaCms\\Database\\Seeders\\RoleAndPermissionSeeder']); $adminRole = Role::where('name', 'Admin')->first(); - $adminUser = User::factory()->create(); + $adminUser = $this->createUser(); $adminUser->assignRole($adminRole); $this->actingAs($adminUser); @@ -35,7 +35,7 @@ public function test_render_page(): void public function test_forbidden(): void { - $user = User::factory()->create(); + $user = $this->createUser(); $this->be($user); $this->get(TargetResource::getUrl('index'))->assertForbidden(); } @@ -89,7 +89,6 @@ public function test_can_save_form(): void $data = TargetModel::create(['name' => $this->faker->words(3, true)]); $new = TargetModel::make(['name' => $this->faker->words(3, true)]); - $updatedTime = now(); Livewire::test(TargetResource\Pages\EditRole::class, [ 'record' => $data->getRoutekey(), ]) @@ -98,6 +97,7 @@ public function test_can_save_form(): void ]) ->call('save') ->assertHasNoFormErrors(); + $updatedTime = now(); $data->refresh(); $this->assertEquals($data->name, $new->name); diff --git a/tests/Filament/TaxonomyResourceTest.php b/tests/Filament/TaxonomyResourceTest.php index 740fd990..30e77c5c 100644 --- a/tests/Filament/TaxonomyResourceTest.php +++ b/tests/Filament/TaxonomyResourceTest.php @@ -22,7 +22,7 @@ protected function setUp(): void $this->artisan('db:seed', ['--class' => '\\Portable\\FilaCms\\Database\\Seeders\\RoleAndPermissionSeeder']); $adminRole = Role::where('name', 'Admin')->first(); - $adminUser = User::factory()->create(); + $adminUser = $this->createUser(); $adminUser->assignRole($adminRole); $this->actingAs($adminUser); @@ -35,7 +35,7 @@ public function test_render_page(): void public function test_forbidden(): void { - $user = User::factory()->create(); + $user = $this->createUser(); $this->be($user); $this->get(TargetResource::getUrl('index'))->assertForbidden(); } @@ -100,7 +100,6 @@ public function test_can_save_form(): void 'name' => $this->faker->firstName, ]); - $updatedTime = now(); Livewire::test(TargetResource\Pages\EditTaxonomy::class, [ 'record' => $data->getRoutekey(), ]) @@ -109,6 +108,7 @@ public function test_can_save_form(): void ]) ->call('save') ->assertHasNoFormErrors(); + $updatedTime = now(); $data->refresh(); $this->assertEquals($data->name, $new->name); diff --git a/tests/Filament/UserResourceTest.php b/tests/Filament/UserResourceTest.php index 1bc0b2c9..bf63ec62 100644 --- a/tests/Filament/UserResourceTest.php +++ b/tests/Filament/UserResourceTest.php @@ -19,7 +19,7 @@ protected function setUp(): void $this->artisan('db:seed', ['--class' => '\\Portable\\FilaCms\\Database\\Seeders\\RoleAndPermissionSeeder']); $adminRole = Role::where('name', 'Admin')->first(); - $adminUser = User::factory()->create(); + $adminUser = $this->createUser(); $adminUser->assignRole($adminRole); $this->actingAs($adminUser); @@ -32,14 +32,18 @@ public function test_render_page(): void public function test_forbidden(): void { - $user = User::factory()->create(); + $user = $this->createUser(); $this->be($user); $this->get(UserResource::getUrl('index'))->assertForbidden(); } public function test_can_list_users(): void { - $users = User::factory()->count(5)->create(); + $users = []; + + for ($i=0; $i < 5; $i++) { + $users[] = $this->createUser(); + } Livewire::test(UserResource\Pages\ListUsers::class)->assertCanSeeTableRecords($users); } diff --git a/tests/TestCase.php b/tests/TestCase.php index a3ae702c..49860ccc 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,9 +4,11 @@ use Illuminate\Contracts\Config\Repository; use Illuminate\Foundation\Testing\RefreshDatabase; +use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Facades\File; use Orchestra\Testbench\Attributes\WithMigration; use Orchestra\Testbench\Concerns\WithWorkbench; +use Portable\FilaCms\Tests\User; #[WithMigration] abstract class TestCase extends \Orchestra\Testbench\TestCase @@ -36,11 +38,15 @@ protected function setUp(): void ->expectsQuestion('Would you like to publish the FilaCMS config?(Y/n)', 'Y') ->expectsQuestion('Would you like to run migrations(Y/n)?', 'Y') ->expectsQuestion('Would you like to add the required trait to your App\\Models\\User model?(Y/n)', 'Y') - ->expectsQuestion('theme.css already exists, do you want to overwrite it?', 'no') - ->expectsQuestion('tailwind.config.js already exists, do you want to overwrite it?', 'no') + // ->expectsQuestion('theme.css already exists, do you want to overwrite it?', 'no') + // ->expectsQuestion('tailwind.config.js already exists, do you want to overwrite it?', 'no') ->expectsOutputToContain('Finished') ->assertExitCode(0); + + Factory::guessFactoryNamesUsing(function (string $modelName) { + return (string) '\\Portable\\FilaCms\\Tests\\Factories\\'.(class_basename($modelName)).'Factory'; + }); } protected function defineEnvironment($app) @@ -49,4 +55,21 @@ protected function defineEnvironment($app) $config->set('auth.providers.users.model', User::class); }); } + + protected function getPackageProviders($app) + { + $packages = parent::getPackageProviders($app); + $packages[] = \RyanChandler\BladeCaptureDirective\BladeCaptureDirectiveServiceProvider::class; + + return $packages; + } + + public function createUser() + { + return User::create([ + 'name' => 'Jeremy Layson', + 'email' => 'jeremy.layson+' . mt_rand(1111, 9999) . '@portable.com.au', + 'password' => 'password', + ]); + } } diff --git a/workbench/.gitignore b/workbench/.gitignore new file mode 100644 index 00000000..72603218 --- /dev/null +++ b/workbench/.gitignore @@ -0,0 +1,2 @@ +.env +.env.dusk diff --git a/workbench/app/Models/.gitkeep b/workbench/app/Models/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/workbench/app/Providers/WorkbenchServiceProvider.php b/workbench/app/Providers/WorkbenchServiceProvider.php new file mode 100644 index 00000000..e8cec9c2 --- /dev/null +++ b/workbench/app/Providers/WorkbenchServiceProvider.php @@ -0,0 +1,24 @@ +get('/user', function (Request $request) { +// return $request->user(); +// }); diff --git a/workbench/routes/console.php b/workbench/routes/console.php new file mode 100644 index 00000000..3c0324c7 --- /dev/null +++ b/workbench/routes/console.php @@ -0,0 +1,19 @@ +comment(Inspiring::quote()); +// })->purpose('Display an inspiring quote'); diff --git a/workbench/routes/web.php b/workbench/routes/web.php new file mode 100644 index 00000000..d259f33e --- /dev/null +++ b/workbench/routes/web.php @@ -0,0 +1,18 @@ +