From ac186b03b1f45eefba992dc671729b018790362b Mon Sep 17 00:00:00 2001 From: davidmercereau Date: Wed, 21 Oct 2026 09:29:39 +0200 Subject: [PATCH] Publication initiale de RelaisSMS : documentation et sources nettoyees --- .editorconfig | 18 + .env.example | 107 + .gitattributes | 11 + .gitignore | 43 + .npmrc | 2 + LICENSE | 232 + README.md | 215 + .../ProcessCalendarRemindersCommand.php | 69 + .../Commands/PruneSmsHistoryCommand.php | 39 + .../Commands/ReconcileSmsCampaignsCommand.php | 44 + .../Commands/SendDueSmsCampaignsCommand.php | 37 + app/Console/Commands/SendTestSmsCommand.php | 96 + .../Commands/SyncCalDavCalendarCommand.php | 32 + .../Commands/SyncCardDavContactsCommand.php | 32 + .../Calendar/CalendarClientInterface.php | 14 + .../CardDav/CardDavClientInterface.php | 13 + .../PhoneNumberNormalizerInterface.php | 10 + app/Contracts/Sms/SmsProviderInterface.php | 14 + .../Auth/AuthenticatedSessionController.php | 48 + .../Controllers/CardDavSyncController.php | 25 + app/Http/Controllers/ContactController.php | 287 + .../Controllers/ContactGroupController.php | 117 + app/Http/Controllers/Controller.php | 8 + .../Controllers/OvhStopCallbackController.php | 83 + .../RecipientSelectionController.php | 186 + app/Http/Controllers/SettingsController.php | 34 + .../Controllers/SmsCampaignController.php | 287 + app/Models/AppSetting.php | 34 + app/Models/CalendarEvent.php | 43 + app/Models/CalendarReminder.php | 45 + app/Models/Contact.php | 94 + app/Models/ContactGroup.php | 44 + app/Models/ContactPhoneNumber.php | 62 + app/Models/SmsCampaign.php | 62 + app/Models/SmsDelivery.php | 54 + app/Models/SourceSyncRun.php | 33 + app/Models/User.php | 32 + app/Providers/AppServiceProvider.php | 40 + .../Calendar/CalDavCalendarClient.php | 232 + .../Calendar/CalendarEventSyncService.php | 214 + .../Calendar/CalendarOccurrenceExpander.php | 82 + .../Calendar/CalendarReminderSender.php | 269 + app/Services/Calendar/CalendarRemoteEvent.php | 12 + app/Services/Calendar/ICalendarParser.php | 341 + app/Services/Calendar/ParsedCalendarAlarm.php | 15 + app/Services/Calendar/ParsedCalendarEvent.php | 25 + app/Services/CardDav/CardDavClient.php | 213 + .../CardDav/CardDavContactSyncService.php | 240 + app/Services/CardDav/CardDavRemoteCard.php | 12 + app/Services/CardDav/ParsedVCard.php | 21 + .../CardDav/ParsedVCardPhoneNumber.php | 11 + app/Services/CardDav/VCardParser.php | 189 + .../Phone/LibPhoneNumberNormalizer.php | 56 + app/Services/Phone/PhoneNumberResult.php | 15 + .../Recipients/RecipientResolutionResult.php | 51 + app/Services/Recipients/RecipientResolver.php | 173 + app/Services/Sms/OvhShortCodeMessage.php | 21 + app/Services/Sms/OvhSmsProvider.php | 256 + app/Services/Sms/SmsCampaignReconciler.php | 99 + app/Services/Sms/SmsCampaignSender.php | 260 + app/Services/Sms/SmsMessageComposer.php | 39 + app/Services/Sms/SmsMessageLength.php | 69 + app/Services/Sms/SmsProviderException.php | 19 + app/Services/Sms/SmsSendResult.php | 21 + artisan | 18 + bootstrap/app.php | 23 + bootstrap/cache/.gitignore | 2 + bootstrap/providers.php | 7 + composer.json | 103 + composer.lock | 8845 +++++++++++++++++ config/app.php | 126 + config/auth.php | 117 + config/cache.php | 136 + config/database.php | 184 + config/filesystems.php | 80 + config/logging.php | 132 + config/mail.php | 118 + config/queue.php | 129 + config/relais_sms.php | 53 + config/services.php | 38 + config/session.php | 233 + cron.php | 37 + database/.gitignore | 1 + database/factories/UserFactory.php | 45 + .../0001_01_01_000000_create_users_table.php | 49 + .../0001_01_01_000001_create_cache_table.php | 35 + .../0001_01_01_000002_create_jobs_table.php | 59 + ...06_11_000000_create_app_settings_table.php | 24 + ...026_06_11_010000_create_contacts_table.php | 35 + ..._11_010100_create_contact_groups_table.php | 31 + ...200_create_contact_phone_numbers_table.php | 32 + ...300_create_contact_contact_group_table.php | 24 + ...0_add_carddav_fields_to_contacts_table.php | 23 + ...1_020100_create_source_sync_runs_table.php | 30 + ...6_11_050000_create_sms_campaigns_table.php | 37 + ..._11_050100_create_sms_deliveries_table.php | 33 + ...audit_selection_to_sms_campaigns_table.php | 28 + ...12_174505_create_calendar_events_table.php | 35 + ...174506_create_calendar_reminders_table.php | 33 + ..._add_scheduling_to_sms_campaigns_table.php | 24 + database/seeders/DatabaseSeeder.php | 52 + doc/afpma-sms-api.md | 37 + doc/cahier-des-charges-afpma-sms.md | 538 + doc/lot-0-decisions-techniques.md | 236 + doc/maquette-afpma-sms.html | 736 ++ package-lock.json | 1232 +++ package.json | 15 + phpstan.neon | 9 + phpunit.xml | 36 + public/.htaccess | 25 + public/favicon.ico | 0 public/index.php | 20 + public/robots.txt | 2 + resources/css/app.css | 899 ++ resources/js/app.js | 274 + resources/views/auth/login.blade.php | 54 + resources/views/contact-groups/edit.blade.php | 112 + resources/views/contacts/create.blade.php | 113 + resources/views/contacts/edit.blade.php | 127 + resources/views/contacts/index.blade.php | 264 + resources/views/contacts/show.blade.php | 151 + resources/views/layouts/app.blade.php | 93 + resources/views/recipients/index.blade.php | 292 + resources/views/settings/edit.blade.php | 57 + resources/views/sms-campaigns/index.blade.php | 129 + resources/views/sms-campaigns/show.blade.php | 142 + routes/console.php | 25 + routes/web.php | 43 + storage/app/.gitignore | 4 + storage/app/private/.gitignore | 2 + storage/app/public/.gitignore | 2 + storage/framework/.gitignore | 9 + storage/framework/cache/.gitignore | 3 + storage/framework/cache/data/.gitignore | 2 + storage/framework/sessions/.gitignore | 2 + storage/framework/testing/.gitignore | 2 + storage/framework/views/.gitignore | 2 + storage/logs/.gitignore | 2 + .../CalendarReminderProcessingTest.php | 291 + .../Calendar/RecurringCalendarTest.php | 151 + .../CardDav/CardDavContactSyncServiceTest.php | 109 + tests/Feature/ContactManagementTest.php | 440 + tests/Feature/ExampleTest.php | 114 + tests/Feature/OvhSmsProviderTest.php | 87 + tests/Feature/OvhStopCallbackTest.php | 108 + tests/Feature/RecipientSelectionTest.php | 216 + tests/Feature/SettingsTest.php | 42 + tests/Feature/SmsCampaignHistoryTest.php | 128 + .../Feature/SmsCampaignReconciliationTest.php | 180 + tests/Feature/SmsCampaignSendTest.php | 358 + tests/TestCase.php | 10 + tests/Unit/Calendar/ICalendarParserTest.php | 75 + tests/Unit/CardDav/VCardParserTest.php | 47 + tests/Unit/ExampleTest.php | 16 + tests/Unit/OvhShortCodeMessageTest.php | 30 + tests/Unit/PhoneNumberNormalizerTest.php | 59 + tests/Unit/SmsMessageLengthTest.php | 36 + vite.config.js | 18 + 158 files changed, 24818 insertions(+) create mode 100644 .editorconfig create mode 100644 .env.example create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .npmrc create mode 100644 LICENSE create mode 100644 README.md create mode 100644 app/Console/Commands/ProcessCalendarRemindersCommand.php create mode 100644 app/Console/Commands/PruneSmsHistoryCommand.php create mode 100644 app/Console/Commands/ReconcileSmsCampaignsCommand.php create mode 100644 app/Console/Commands/SendDueSmsCampaignsCommand.php create mode 100644 app/Console/Commands/SendTestSmsCommand.php create mode 100644 app/Console/Commands/SyncCalDavCalendarCommand.php create mode 100644 app/Console/Commands/SyncCardDavContactsCommand.php create mode 100644 app/Contracts/Calendar/CalendarClientInterface.php create mode 100644 app/Contracts/CardDav/CardDavClientInterface.php create mode 100644 app/Contracts/PhoneNumberNormalizerInterface.php create mode 100644 app/Contracts/Sms/SmsProviderInterface.php create mode 100644 app/Http/Controllers/Auth/AuthenticatedSessionController.php create mode 100644 app/Http/Controllers/CardDavSyncController.php create mode 100644 app/Http/Controllers/ContactController.php create mode 100644 app/Http/Controllers/ContactGroupController.php create mode 100644 app/Http/Controllers/Controller.php create mode 100644 app/Http/Controllers/OvhStopCallbackController.php create mode 100644 app/Http/Controllers/RecipientSelectionController.php create mode 100644 app/Http/Controllers/SettingsController.php create mode 100644 app/Http/Controllers/SmsCampaignController.php create mode 100644 app/Models/AppSetting.php create mode 100644 app/Models/CalendarEvent.php create mode 100644 app/Models/CalendarReminder.php create mode 100644 app/Models/Contact.php create mode 100644 app/Models/ContactGroup.php create mode 100644 app/Models/ContactPhoneNumber.php create mode 100644 app/Models/SmsCampaign.php create mode 100644 app/Models/SmsDelivery.php create mode 100644 app/Models/SourceSyncRun.php create mode 100644 app/Models/User.php create mode 100644 app/Providers/AppServiceProvider.php create mode 100644 app/Services/Calendar/CalDavCalendarClient.php create mode 100644 app/Services/Calendar/CalendarEventSyncService.php create mode 100644 app/Services/Calendar/CalendarOccurrenceExpander.php create mode 100644 app/Services/Calendar/CalendarReminderSender.php create mode 100644 app/Services/Calendar/CalendarRemoteEvent.php create mode 100644 app/Services/Calendar/ICalendarParser.php create mode 100644 app/Services/Calendar/ParsedCalendarAlarm.php create mode 100644 app/Services/Calendar/ParsedCalendarEvent.php create mode 100644 app/Services/CardDav/CardDavClient.php create mode 100644 app/Services/CardDav/CardDavContactSyncService.php create mode 100644 app/Services/CardDav/CardDavRemoteCard.php create mode 100644 app/Services/CardDav/ParsedVCard.php create mode 100644 app/Services/CardDav/ParsedVCardPhoneNumber.php create mode 100644 app/Services/CardDav/VCardParser.php create mode 100644 app/Services/Phone/LibPhoneNumberNormalizer.php create mode 100644 app/Services/Phone/PhoneNumberResult.php create mode 100644 app/Services/Recipients/RecipientResolutionResult.php create mode 100644 app/Services/Recipients/RecipientResolver.php create mode 100644 app/Services/Sms/OvhShortCodeMessage.php create mode 100644 app/Services/Sms/OvhSmsProvider.php create mode 100644 app/Services/Sms/SmsCampaignReconciler.php create mode 100644 app/Services/Sms/SmsCampaignSender.php create mode 100644 app/Services/Sms/SmsMessageComposer.php create mode 100644 app/Services/Sms/SmsMessageLength.php create mode 100644 app/Services/Sms/SmsProviderException.php create mode 100644 app/Services/Sms/SmsSendResult.php create mode 100755 artisan create mode 100644 bootstrap/app.php create mode 100644 bootstrap/cache/.gitignore create mode 100644 bootstrap/providers.php create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 config/app.php create mode 100644 config/auth.php create mode 100644 config/cache.php create mode 100644 config/database.php create mode 100644 config/filesystems.php create mode 100644 config/logging.php create mode 100644 config/mail.php create mode 100644 config/queue.php create mode 100644 config/relais_sms.php create mode 100644 config/services.php create mode 100644 config/session.php create mode 100644 cron.php create mode 100644 database/.gitignore create mode 100644 database/factories/UserFactory.php create mode 100644 database/migrations/0001_01_01_000000_create_users_table.php create mode 100644 database/migrations/0001_01_01_000001_create_cache_table.php create mode 100644 database/migrations/0001_01_01_000002_create_jobs_table.php create mode 100644 database/migrations/2026_06_11_000000_create_app_settings_table.php create mode 100644 database/migrations/2026_06_11_010000_create_contacts_table.php create mode 100644 database/migrations/2026_06_11_010100_create_contact_groups_table.php create mode 100644 database/migrations/2026_06_11_010200_create_contact_phone_numbers_table.php create mode 100644 database/migrations/2026_06_11_010300_create_contact_contact_group_table.php create mode 100644 database/migrations/2026_06_11_020000_add_carddav_fields_to_contacts_table.php create mode 100644 database/migrations/2026_06_11_020100_create_source_sync_runs_table.php create mode 100644 database/migrations/2026_06_11_050000_create_sms_campaigns_table.php create mode 100644 database/migrations/2026_06_11_050100_create_sms_deliveries_table.php create mode 100644 database/migrations/2026_06_11_060000_add_audit_selection_to_sms_campaigns_table.php create mode 100644 database/migrations/2026_06_12_174505_create_calendar_events_table.php create mode 100644 database/migrations/2026_06_12_174506_create_calendar_reminders_table.php create mode 100644 database/migrations/2026_06_12_200000_add_scheduling_to_sms_campaigns_table.php create mode 100644 database/seeders/DatabaseSeeder.php create mode 100644 doc/afpma-sms-api.md create mode 100644 doc/cahier-des-charges-afpma-sms.md create mode 100644 doc/lot-0-decisions-techniques.md create mode 100644 doc/maquette-afpma-sms.html create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 phpstan.neon create mode 100644 phpunit.xml create mode 100644 public/.htaccess create mode 100644 public/favicon.ico create mode 100644 public/index.php create mode 100644 public/robots.txt create mode 100644 resources/css/app.css create mode 100644 resources/js/app.js create mode 100644 resources/views/auth/login.blade.php create mode 100644 resources/views/contact-groups/edit.blade.php create mode 100644 resources/views/contacts/create.blade.php create mode 100644 resources/views/contacts/edit.blade.php create mode 100644 resources/views/contacts/index.blade.php create mode 100644 resources/views/contacts/show.blade.php create mode 100644 resources/views/layouts/app.blade.php create mode 100644 resources/views/recipients/index.blade.php create mode 100644 resources/views/settings/edit.blade.php create mode 100644 resources/views/sms-campaigns/index.blade.php create mode 100644 resources/views/sms-campaigns/show.blade.php create mode 100644 routes/console.php create mode 100644 routes/web.php create mode 100644 storage/app/.gitignore create mode 100644 storage/app/private/.gitignore create mode 100644 storage/app/public/.gitignore create mode 100644 storage/framework/.gitignore create mode 100644 storage/framework/cache/.gitignore create mode 100644 storage/framework/cache/data/.gitignore create mode 100644 storage/framework/sessions/.gitignore create mode 100644 storage/framework/testing/.gitignore create mode 100644 storage/framework/views/.gitignore create mode 100644 storage/logs/.gitignore create mode 100644 tests/Feature/Calendar/CalendarReminderProcessingTest.php create mode 100644 tests/Feature/Calendar/RecurringCalendarTest.php create mode 100644 tests/Feature/CardDav/CardDavContactSyncServiceTest.php create mode 100644 tests/Feature/ContactManagementTest.php create mode 100644 tests/Feature/ExampleTest.php create mode 100644 tests/Feature/OvhSmsProviderTest.php create mode 100644 tests/Feature/OvhStopCallbackTest.php create mode 100644 tests/Feature/RecipientSelectionTest.php create mode 100644 tests/Feature/SettingsTest.php create mode 100644 tests/Feature/SmsCampaignHistoryTest.php create mode 100644 tests/Feature/SmsCampaignReconciliationTest.php create mode 100644 tests/Feature/SmsCampaignSendTest.php create mode 100644 tests/TestCase.php create mode 100644 tests/Unit/Calendar/ICalendarParserTest.php create mode 100644 tests/Unit/CardDav/VCardParserTest.php create mode 100644 tests/Unit/ExampleTest.php create mode 100644 tests/Unit/OvhShortCodeMessageTest.php create mode 100644 tests/Unit/PhoneNumberNormalizerTest.php create mode 100644 tests/Unit/SmsMessageLengthTest.php create mode 100644 vite.config.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6df8428 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 + +[{compose,docker-compose}.{yml,yaml}] +indent_size = 4 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..d3b0277 --- /dev/null +++ b/.env.example @@ -0,0 +1,107 @@ +APP_NAME=RelaisSMS +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost + +APP_LOCALE=fr +APP_FALLBACK_LOCALE=fr +APP_FAKER_LOCALE=fr_FR + +APP_MAINTENANCE_DRIVER=file +# APP_MAINTENANCE_STORE=database + +# PHP_CLI_SERVER_WORKERS=4 + +BCRYPT_ROUNDS=12 + +LOG_CHANNEL=stack +LOG_STACK=single +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug + +DB_CONNECTION=sqlite +# DB_HOST=127.0.0.1 +# DB_PORT=3306 +# DB_DATABASE=laravel +# DB_USERNAME=root +# DB_PASSWORD= + +SESSION_DRIVER=database +SESSION_LIFETIME=120 +SESSION_ENCRYPT=false +SESSION_PATH=/ +SESSION_DOMAIN=null + +BROADCAST_CONNECTION=log +FILESYSTEM_DISK=local +QUEUE_CONNECTION=database + +CACHE_STORE=database +# CACHE_PREFIX= + +MEMCACHED_HOST=127.0.0.1 + +REDIS_CLIENT=phpredis +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=log +MAIL_SCHEME=null +MAIL_HOST=127.0.0.1 +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_FROM_ADDRESS="hello@example.com" +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +VITE_APP_NAME="${APP_NAME}" + +RELAIS_SMS_ADMIN_NAME="Administrateur RelaisSMS" +RELAIS_SMS_ADMIN_EMAIL=admin@relais-sms.test +RELAIS_SMS_ADMIN_PASSWORD=relais-sms + +RELAIS_SMS_DEFAULT_COUNTRY=FR +RELAIS_SMS_MAX_SMS_PER_CAMPAIGN=100 +RELAIS_SMS_HISTORY_RETENTION_YEARS=3 +RELAIS_SMS_SCHEDULED_SENDS_ENABLED=true +RELAIS_SMS_ACTIVE_SMS_PROVIDER=ovh +RELAIS_SMS_GALETTE_SYNC_ENABLED=false +RELAIS_SMS_CARDDAV_SYNC_ENABLED=false +RELAIS_SMS_CARDDAV_URL= +RELAIS_SMS_CARDDAV_USERNAME= +RELAIS_SMS_CARDDAV_PASSWORD= +RELAIS_SMS_CARDDAV_TIMEOUT=20 +RELAIS_SMS_CALDAV_CALENDAR_SYNC_ENABLED=false +RELAIS_SMS_CALDAV_CALENDAR_URL= +RELAIS_SMS_CALDAV_CALENDAR_USERNAME= +RELAIS_SMS_CALDAV_CALENDAR_PASSWORD= +RELAIS_SMS_CALDAV_CALENDAR_TIMEOUT=20 +RELAIS_SMS_CALDAV_CALENDAR_LOOKAHEAD_DAYS=90 +RELAIS_SMS_CALDAV_SYNC_INTERVAL_MINUTES=60 +RELAIS_SMS_CALDAV_DEFAULT_CONTACT_IDS= +RELAIS_SMS_CALDAV_DEFAULT_GROUP_IDS= +RELAIS_SMS_CALDAV_REMINDER_USER_ID= +RELAIS_SMS_CALDAV_REMINDER_HEADER= +RELAIS_SMS_CALDAV_REMINDER_FOOTER= +RELAIS_SMS_CALDAV_DESCRIPTION_MAX_LENGTH=120 +RELAIS_SMS_CALDAV_TIMEZONE=Europe/Paris + +OVH_ENDPOINT=ovh-eu +OVH_APPLICATION_KEY= +OVH_APPLICATION_SECRET= +OVH_CONSUMER_KEY= +OVH_SMS_SERVICE_NAME= +OVH_SMS_SENDER= +OVH_SMS_SHORT_CODE=true +OVH_SMS_NO_STOP_CLAUSE=true +OVH_SMS_STOP_CALLBACK_TOKEN= +OVH_SMS_TIMEOUT=20 +OVH_SMS_SEND_TIMEOUT=60 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fcb21d3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +* text=auto eol=lf + +*.blade.php diff=html +*.css diff=css +*.html diff=html +*.md diff=markdown +*.php diff=php + +/.github export-ignore +CHANGELOG.md export-ignore +.styleci.yml export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c3aea6d --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +*.log +.DS_Store +.env +.env.* +!.env.example +*.sqlite +*.sqlite-* +*.sqlite3 +*.sqlite3-* +*.db +*.db-* +*.sql +*.sql.gz +*.pem +*.key +*.p12 +*.pfx +/.git-credentials +/AGENTS.md +/backups/ +/doc/tmp/ +.phpactor.json +.phpunit.result.cache +/.codex +/.cursor/ +/.idea +/.nova +/.phpunit.cache +/.vscode +/.zed +/auth.json +/node_modules +/public/build +/public/fonts-manifest.dev.json +/public/hot +/public/storage +/storage/*.key +/storage/pail +/vendor +_ide_helper.php +Homestead.json +Homestead.yaml +Thumbs.db diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..495a6af --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +ignore-scripts=true +audit=true diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..789e7d9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,232 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + RelaisSMS + Copyright (C) 2026 afpma + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + RelaisSMS Copyright (C) 2026 afpma + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . diff --git a/README.md b/README.md new file mode 100644 index 0000000..66ac10b --- /dev/null +++ b/README.md @@ -0,0 +1,215 @@ +# RelaisSMS + +**Vos contacts, votre agenda, vos SMS — au même endroit.** + +RelaisSMS est une petite application web auto-hébergée qui permet d'envoyer des SMS à des contacts ou à des groupes, immédiatement ou à une date choisie. Elle relie un carnet d'adresses **CardDAV**, un agenda **CalDAV** et l'API **OVHcloud SMS** pour centraliser les notifications et automatiser les rappels de rendez-vous. + +Pensée à l'origine pour les besoins d'une association, elle propose une interface en français et fonctionne avec PHP et une base SQLite. Les contacts peuvent aussi être gérés directement dans l'application, sans serveur DAV. + +## Fonctionnalités + +| Domaine | Ce que fait RelaisSMS | +| --- | --- | +| **Contacts** | Fiches locales ou synchronisées par CardDAV, plusieurs numéros, normalisation au format international et détection des mobiles. | +| **Groupes et favoris** | Sélection de contacts et de groupes, recherche et accès rapide aux favoris. | +| **Préparation des envois** | Aperçu des destinataires, dédoublonnage des numéros, exclusion des contacts en refus SMS et limite de destinataires configurable. | +| **Campagnes SMS** | Envoi immédiat ou programmé, annulation avant envoi, en-tête et pied de message configurables. | +| **Rappels d'agenda** | Synchronisation CalDAV, alarmes de notification, événements récurrents, exceptions et annulations. | +| **Suivi** | Historique des campagnes et de leurs destinataires, statuts détaillés, filtres et export CSV. | +| **Envois incertains** | Rapprochement avec l'historique OVH après une interruption ou un délai dépassé, sans renvoi automatique. | +| **Désinscription** | Refus SMS géré dans l'interface et prise en compte des réponses STOP via un callback OVH protégé par un jeton. | +| **Exploitation** | Commandes CLI, tâches planifiées, suivi des synchronisations et purge de l'historique selon une durée configurable. | + +**Intégrations disponibles :** CardDAV et CalDAV, notamment avec Nextcloud, et OVHcloud SMS. Le connecteur Galette et les autres fournisseurs SMS restent des pistes d'évolution ; ils ne sont pas implémentés. + +## Comment ça fonctionne ? + +1. Ajoutez vos contacts ou synchronisez votre carnet CardDAV. +2. Sélectionnez des contacts ou des groupes et vérifiez les numéros retenus. +3. Rédigez votre message, puis envoyez-le immédiatement ou programmez-le. +4. Consultez le résultat dans l'historique et exportez-le si nécessaire. + +Pour les rappels automatiques, ajoutez un événement et une alarme de type **notification** dans votre agenda CalDAV. RelaisSMS retrouve les contacts correspondant aux adresses e-mail de l'organisateur et des participants, puis prépare les SMS à l'échéance de l'alarme. Des contacts ou groupes fixes peuvent compléter cette liste. + +## Stack et prérequis + +- **PHP 8.3+**, Composer et les extensions Laravel usuelles, dont PDO SQLite, mbstring, OpenSSL, XML, DOM, ctype et fileinfo. +- **Laravel 13**, vues Blade et **Tailwind CSS 4**. +- **Node.js 20.19+ ou 22.12+** et npm pour construire les assets avec **Vite 8**. +- **SQLite** par défaut ; les autres connexions Laravel nécessitent leur propre configuration et validation. +- Un compte OVHcloud SMS avec des crédits et des identifiants API pour les envois réels. +- Un serveur CardDAV et/ou CalDAV si vous souhaitez utiliser les synchronisations. + +## Installation locale + +```bash +git clone https://git.afpma.pro/afpma/RelaisSMS.git +cd RelaisSMS +composer install +cp .env.example .env +touch database/database.sqlite +php artisan key:generate +php artisan migrate --seed +npm ci +npm run build +php artisan serve +``` + +Ouvrez ensuite **http://127.0.0.1:8000/login**. + +Le compte de développement créé par le seeder est `admin@relais-sms.test`, avec le mot de passe `relais-sms`. Ces valeurs de démonstration sont réservées au développement. Définissez vos propres `RELAIS_SMS_ADMIN_NAME`, `RELAIS_SMS_ADMIN_EMAIL` et `RELAIS_SMS_ADMIN_PASSWORD` dans `.env` **avant toute installation accessible au public**. Le seeder refuse de créer un compte avec le mot de passe par défaut ou un mot de passe vide hors des environnements `local` et `testing`. + +Le seeder ne change pas le mot de passe d'un compte déjà existant. Modifier `.env` puis relancer `db:seed` ne constitue donc pas une réinitialisation du mot de passe. + +Sans identifiants OVH, l'application reste utilisable pour gérer les contacts et préparer les sélections ; les envois réels échoueront. Pour travailler sur l'interface, lancez `npm run dev` dans un second terminal. Pour exécuter les tâches planifiées localement : + +```bash +php artisan schedule:work +``` + +Ce scheduler peut déclencher des envois si les intégrations sont configurées et si des campagnes ou rappels sont dus. + +## Configuration + +Le fichier [`.env.example`](.env.example) décrit les variables disponibles. Copiez-le en `.env` et renseignez vos secrets uniquement dans ce fichier, jamais dans le dépôt. Après une modification de configuration, exécutez `php artisan config:clear`. + +### SMS OVHcloud + +```dotenv +RELAIS_SMS_ACTIVE_SMS_PROVIDER=ovh +OVH_ENDPOINT=ovh-eu +OVH_APPLICATION_KEY= +OVH_APPLICATION_SECRET= +OVH_CONSUMER_KEY= +OVH_SMS_SERVICE_NAME= +OVH_SMS_SENDER= +OVH_SMS_SHORT_CODE=true +OVH_SMS_NO_STOP_CLAUSE=true +OVH_SMS_STOP_CALLBACK_TOKEN= +OVH_SMS_TIMEOUT=20 +OVH_SMS_SEND_TIMEOUT=60 +``` + +Renseignez les clés et le service SMS dans `.env`. Les autorisations API utilisées sont : + +- `GET /sms` pour consulter les services ; +- `POST /sms/{serviceName}/jobs` pour envoyer ; +- `GET /sms/{serviceName}/outgoing` et `GET /sms/{serviceName}/outgoing/*` pour rapprocher les envois incertains. + +Deux modes d'expéditeur sont proposés : + +| Mode | Configuration | Comportement | +| --- | --- | --- | +| Numéro court avec réponse | `OVH_SMS_SHORT_CODE=true`, expéditeur vide | RelaisSMS retire les liens et domaines du texte envoyé. Les libellés des liens Markdown et HTML sont conservés. | +| Expéditeur personnalisé | `OVH_SMS_SHORT_CODE=false`, `OVH_SMS_SENDER` renseigné | Les liens sont conservés ; le nom d'expéditeur doit être accepté par OVH. | + +Un texte devenu vide après filtrage est refusé. L'historique conserve le message effectivement transmis. `OVH_SMS_NO_STOP_CLAUSE` contrôle la demande de clause STOP auprès du fournisseur ; adaptez ce réglage à la nature de vos messages et aux conditions du service. + +**Un délai dépassé ne signifie pas forcément que le SMS n'est pas parti.** Les campagnes concernées passent en « À vérifier ». La commande suivante consulte l'historique OVH sans renvoyer de SMS : + +```bash +php artisan sms-campaigns:reconcile +``` + +Elle traite aussi les campagnes bloquées en « Envoi » depuis plus de dix minutes. Une absence de résultat ne suffit pas à déclarer l'envoi en échec. Le statut « Envoyé » indique une acceptation par OVH, pas une confirmation de livraison au téléphone. + +Pour les réponses STOP, générez un jeton aléatoire dédié dans `OVH_SMS_STOP_CALLBACK_TOKEN`, puis configurez chez OVH l'URL de callback STOP : + +```text +https://sms.example.org/ovh/sms/stop-callback?token=VOTRE_JETON +``` + +Le callback marque les contacts correspondant au numéro reçu en refus SMS. Le callback de changement d'état de livraison n'est pas implémenté. + +### Carnet d'adresses CardDAV + +```dotenv +RELAIS_SMS_CARDDAV_SYNC_ENABLED=true +RELAIS_SMS_CARDDAV_URL=https://cloud.example.org/remote.php/dav/addressbooks/users/UTILISATEUR/CARNET/ +RELAIS_SMS_CARDDAV_USERNAME= +RELAIS_SMS_CARDDAV_PASSWORD= +``` + +Utilisez de préférence un mot de passe d'application DAV. Une synchronisation peut être lancée depuis l'interface ou avec `php artisan contacts:sync-carddav`. Le scheduler la prévoit toutes les heures. + +### Agenda CalDAV et rappels + +```dotenv +RELAIS_SMS_CALDAV_CALENDAR_SYNC_ENABLED=true +RELAIS_SMS_CALDAV_CALENDAR_URL=https://cloud.example.org/remote.php/dav/calendars/UTILISATEUR/CALENDRIER/ +RELAIS_SMS_CALDAV_CALENDAR_USERNAME= +RELAIS_SMS_CALDAV_CALENDAR_PASSWORD= +RELAIS_SMS_CALDAV_CALENDAR_LOOKAHEAD_DAYS=90 +RELAIS_SMS_CALDAV_SYNC_INTERVAL_MINUTES=60 +RELAIS_SMS_CALDAV_DEFAULT_CONTACT_IDS= +RELAIS_SMS_CALDAV_DEFAULT_GROUP_IDS= +RELAIS_SMS_CALDAV_TIMEZONE=Europe/Paris +``` + +- Seules les alarmes `VALARM` avec `ACTION:DISPLAY` déclenchent un SMS. Les alarmes e-mail sont ignorées. +- L'organisateur et les participants sont rapprochés des contacts par leur adresse e-mail ; un mobile valide est nécessaire. +- Les identifiants de contacts et groupes par défaut sont séparés par des virgules. +- Les récurrences `RRULE`, les dates `RDATE`, les exclusions `EXDATE`, ainsi que les occurrences modifiées ou annulées sont prises en compte dans la fenêtre de synchronisation. +- Chaque occurrence et son alarme disposent d'une protection contre les doublons. Les rappels déjà envoyés ou incertains ne sont pas renvoyés lors d'une synchronisation. +- Un rappel tient dans **un seul segment SMS** : titre et date sont prioritaires, puis lieu et description selon la place disponible et l'encodage GSM ou Unicode. +- Le préfixe, le suffixe et la longueur de description sont réglables avec les variables `RELAIS_SMS_CALDAV_REMINDER_HEADER`, `RELAIS_SMS_CALDAV_REMINDER_FOOTER` et `RELAIS_SMS_CALDAV_DESCRIPTION_MAX_LENGTH`. + +Pour importer l'agenda sans traiter les envois : + +```bash +php artisan calendar:sync-caldav +``` + +`calendar:process-reminders` traite les rappels dus et synchronise l'agenda si l'intervalle configuré est écoulé. Ses options `--no-sync` et `--force-sync` permettent respectivement d'ignorer ou de forcer cette synchronisation. **Cette commande peut envoyer des SMS.** + +## Tâches planifiées + +### Serveur avec cron à la minute + +```cron +* * * * * cd /chemin/vers/RelaisSMS && php artisan schedule:run >> /dev/null 2>&1 +``` + +Le scheduler vérifie chaque minute les rappels, les campagnes dues et les envois incertains. CardDAV est synchronisé toutes les heures ; les lectures CalDAV suivent l'intervalle configuré. L'historique expiré est purgé chaque jour à 02:30 selon le fuseau du scheduler Laravel. + +### Hébergement mutualisé OVHcloud + +Si le planificateur ne permet qu'un passage horaire, configurez une seule tâche PHP 8.3 pointant vers `RelaisSMS/cron.php` (adaptez le chemin au dossier d'installation). + +Ce point d'entrée **CLI uniquement** exécute explicitement, dans l'ordre : CardDAV, CalDAV et les rappels dus, les campagnes programmées, le rapprochement OVH, puis la purge de l'historique. Un simple `schedule:run` lancé à une minute quelconque de chaque heure pourrait manquer les tâches prévues à une heure précise. + +La précision dépend du planificateur : avec un passage par heure, un envoi peut être retardé d'environ **0 à 60 minutes**. Les commandes traitent par défaut jusqu'à 50 rappels ou 50 campagnes par passage ; un volume supérieur peut prolonger ce délai. Activez les rapports d'erreur du planificateur. + +## Déploiement et données privées + +1. Construisez les dépendances et les assets : `composer install --no-dev --optimize-autoloader`, `npm ci`, puis `npm run build`. Sur un hébergement sans Composer, transférez aussi `vendor/` depuis un environnement compatible. +2. Configurez le serveur web pour exposer **uniquement `public/`**. Si l'hébergeur impose une autre disposition, bloquez l'accès HTTP aux fichiers privés et conservez les fichiers de routage propres à l'installation. +3. Créez le `.env` du serveur avec ses propres secrets et `APP_ENV=production`, `APP_DEBUG=false`, une `APP_URL` HTTPS et `SESSION_SECURE_COOKIE=true`. +4. Sauvegardez le code remplacé, `.env` et SQLite avant toute mise à jour. Protégez les sauvegardes et `.env` avec des permissions restrictives, par exemple `600` ; autorisez l'écriture sur `storage/` et `bootstrap/cache/` au processus PHP. +5. Passez en maintenance avec `php artisan down`, transférez le code et les assets, appliquez `php artisan migrate --force`, puis `php artisan optimize:clear`. Lors de la première installation uniquement, créez le compte avec `php artisan db:seed --force` après avoir défini son mot de passe. +6. Remettez le service en ligne avec `php artisan up`, vérifiez la connexion et configurez le planificateur. + +Conservez l'`APP_KEY`, les données et le jeton STOP lors des mises à jour. Sur l'installation mutualisée OVHcloud à l'origine du projet, **n'activez pas `config:cache` ni `artisan optimize`** : le cache de configuration y a provoqué une erreur HTTP 500. `view:cache` peut être utilisé séparément. + +Le dépôt exclut les fichiers `.env` privés, bases locales, journaux, sessions, exports temporaires, sauvegardes et consignes locales d'exploitation. Ne publiez pas de véritables coordonnées dans des fixtures ou des captures d'écran. L'historique applicatif contient des données personnelles : sa rétention est réglée par `RELAIS_SMS_HISTORY_RETENTION_YEARS` (3 ans par défaut). Prévisualisez la purge avec : + +```bash +php artisan sms-campaigns:prune-history --dry-run +``` + +## Tests et contribution + +```bash +php artisan test --compact +vendor/bin/pint --test +vendor/bin/phpstan analyse --memory-limit=1G --no-progress +npm run build +``` + +Les tests utilisent SQLite en mémoire ; les tests des intégrations utilisent des doublures HTTP. N'utilisez pas vos identifiants de production pour les tests. La commande `sms:send-test` effectue un envoi réel et consomme des crédits : ne l'exécutez qu'avec l'accord du destinataire et une autorisation explicite. + +Les documents de conception et la maquette initiale sont dans [`doc/`](doc/). Ils décrivent aussi des intentions historiques ; le tableau des fonctionnalités ci-dessus présente le périmètre actuellement implémenté. + +## Licence + +RelaisSMS est distribué sous [licence GNU GPL v3](LICENSE), conservée depuis l’initialisation du dépôt. Les dépendances restent soumises à leurs licences respectives. diff --git a/app/Console/Commands/ProcessCalendarRemindersCommand.php b/app/Console/Commands/ProcessCalendarRemindersCommand.php new file mode 100644 index 0000000..82bd504 --- /dev/null +++ b/app/Console/Commands/ProcessCalendarRemindersCommand.php @@ -0,0 +1,69 @@ +shouldSync()) { + try { + $run = $syncService->sync(); + $this->line((string) $run->message); + } catch (Throwable $exception) { + $this->error('Synchronisation CalDAV agenda en echec : '.$exception->getMessage()); + + return self::FAILURE; + } + } elseif (! $this->option('no-sync')) { + $interval = (int) config('relais_sms.caldav.sync_interval_minutes', 60); + $this->line('Synchronisation CalDAV ignoree : derniere synchronisation recente, intervalle '.$interval.' minute(s).'); + } + + $sent = $sender->sendDue(); + $this->info($sent.' rappel(s) SMS envoye(s).'); + + return self::SUCCESS; + } + + private function shouldSync(): bool + { + if ($this->option('no-sync')) { + return false; + } + + if ($this->option('force-sync')) { + return true; + } + + $interval = max(1, (int) config('relais_sms.caldav.sync_interval_minutes', 60)); + $lastRun = SourceSyncRun::query() + ->where('source', 'caldav_calendar') + ->latest('started_at') + ->first(); + + $rawStartedAt = $lastRun?->getRawOriginal('started_at'); + + if ($rawStartedAt === null) { + return true; + } + + $lastStartedAt = Carbon::parse((string) $rawStartedAt, 'UTC'); + $nextAllowedSyncAt = Carbon::now()->utc()->subMinutes($interval); + + return $lastStartedAt->lessThanOrEqualTo($nextAllowedSyncAt); + } +} diff --git a/app/Console/Commands/PruneSmsHistoryCommand.php b/app/Console/Commands/PruneSmsHistoryCommand.php new file mode 100644 index 0000000..42151c8 --- /dev/null +++ b/app/Console/Commands/PruneSmsHistoryCommand.php @@ -0,0 +1,39 @@ +error('La retention doit etre superieure ou egale a 1 an.'); + + return self::FAILURE; + } + + $expiresBefore = now()->subYears($retentionYears); + $query = SmsCampaign::query()->where('created_at', '<', $expiresBefore); + $count = $query->count(); + + if ($this->option('dry-run')) { + $this->line($count.' campagne(s) SMS expiree(s) avant '.$expiresBefore->format('Y-m-d H:i:s').'.'); + + return self::SUCCESS; + } + + $query->delete(); + $this->line($count.' campagne(s) SMS supprimee(s).'); + + return self::SUCCESS; + } +} diff --git a/app/Console/Commands/ReconcileSmsCampaignsCommand.php b/app/Console/Commands/ReconcileSmsCampaignsCommand.php new file mode 100644 index 0000000..44f12d6 --- /dev/null +++ b/app/Console/Commands/ReconcileSmsCampaignsCommand.php @@ -0,0 +1,44 @@ +where('provider', 'ovh') + ->where(function (Builder $query): void { + $query->where('status', 'uncertain') + ->orWhere(fn (Builder $query): Builder => $query->where('status', 'sending')->where('updated_at', '<', now()->subMinutes(10))); + }) + ->orderBy('updated_at') + ->limit(max(1, (int) $this->option('limit'))) + ->get() + ->each(function (SmsCampaign $campaign) use ($reconciler, &$processed): void { + if ($campaign->status === 'sending') { + $campaign->update([ + 'status' => 'uncertain', + 'error_message' => 'Envoi interrompu avant confirmation. Verification OVH necessaire ; ne pas renvoyer cette campagne.', + ]); + $campaign->deliveries()->where('status', 'queued')->update(['status' => 'uncertain']); + } + $reconciler->reconcile($campaign); + $processed++; + }); + + $this->line($processed.' campagne(s) verifiee(s), sans nouvel envoi.'); + + return self::SUCCESS; + } +} diff --git a/app/Console/Commands/SendDueSmsCampaignsCommand.php b/app/Console/Commands/SendDueSmsCampaignsCommand.php new file mode 100644 index 0000000..26700c8 --- /dev/null +++ b/app/Console/Commands/SendDueSmsCampaignsCommand.php @@ -0,0 +1,37 @@ +option('limit')); + $processed = 0; + + SmsCampaign::query() + ->where('status', 'scheduled') + ->whereNotNull('scheduled_at') + ->where('scheduled_at', '<=', now()) + ->orderBy('scheduled_at') + ->limit($limit) + ->get() + ->each(function (SmsCampaign $campaign) use ($sender, &$processed): void { + if ($sender->sendScheduled($campaign) !== null) { + $processed++; + } + }); + + $this->line($processed.' campagne(s) SMS programmee(s) prise(s) en charge.'); + + return self::SUCCESS; + } +} diff --git a/app/Console/Commands/SendTestSmsCommand.php b/app/Console/Commands/SendTestSmsCommand.php new file mode 100644 index 0000000..277f831 --- /dev/null +++ b/app/Console/Commands/SendTestSmsCommand.php @@ -0,0 +1,96 @@ +argument('phone'); + $message = trim((string) $this->option('message')); + $normalized = $normalizer->normalize($phone, (string) config('relais_sms.default_settings.default_country', 'FR')); + + if (! $normalized->isValid || ! $normalized->isMobile || $normalized->normalizedNumber === null) { + $this->error($normalized->error ?: 'Numero invalide ou non mobile.'); + + return self::FAILURE; + } + + if ($message === '') { + $this->error('Message vide.'); + + return self::FAILURE; + } + + [$contact, $phoneNumber] = DB::transaction(function () use ($normalized): array { + $phoneNumber = ContactPhoneNumber::query() + ->where('normalized_number', $normalized->normalizedNumber) + ->with('contact') + ->first(); + + if ($phoneNumber !== null && $phoneNumber->contact !== null) { + return [$phoneNumber->contact, $phoneNumber]; + } + + $contact = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'Test', + 'last_name' => 'RelaisSMS', + 'notes' => 'Contact cree pour test envoi SMS.', + ]); + + $phoneNumber = $contact->phoneNumbers()->create([ + 'label' => 'Test', + 'raw_number' => $normalized->rawNumber, + 'normalized_number' => $normalized->normalizedNumber, + 'country' => $normalized->country, + 'is_valid' => $normalized->isValid, + 'is_mobile' => $normalized->isMobile, + 'is_primary' => true, + 'validation_error' => $normalized->error, + ]); + + return [$contact, $phoneNumber]; + }); + + $user = User::query()->first(); + + if ($user === null) { + $this->error('Aucun utilisateur applicatif disponible.'); + + return self::FAILURE; + } + + $campaign = $sender->send($user, $message, [[ + 'contact_id' => $contact->id, + 'contact_name' => $contact->displayName(), + 'phone_number_id' => $phoneNumber->id, + 'number' => $normalized->normalizedNumber, + 'raw_number' => $normalized->rawNumber, + 'label' => $phoneNumber->label, + 'selection' => ['Test CLI'], + ]]); + + $this->line('Campagne #'.$campaign->id.' : '.$campaign->status); + + if ($campaign->error_message !== null) { + $this->error($campaign->error_message); + + return self::FAILURE; + } + + return $campaign->status === 'failed' ? self::FAILURE : self::SUCCESS; + } +} diff --git a/app/Console/Commands/SyncCalDavCalendarCommand.php b/app/Console/Commands/SyncCalDavCalendarCommand.php new file mode 100644 index 0000000..20c8118 --- /dev/null +++ b/app/Console/Commands/SyncCalDavCalendarCommand.php @@ -0,0 +1,32 @@ +sync(); + } catch (Throwable $exception) { + $this->error('Synchronisation CalDAV agenda en echec : '.$exception->getMessage()); + + return self::FAILURE; + } + + $this->info((string) $run->message); + $this->line('Objets lus : '.$run->fetched_contacts); + $this->line('Evenements synchronises : '.$run->synced_contacts); + $this->line('Evenements annules localement : '.$run->deleted_contacts); + + return self::SUCCESS; + } +} diff --git a/app/Console/Commands/SyncCardDavContactsCommand.php b/app/Console/Commands/SyncCardDavContactsCommand.php new file mode 100644 index 0000000..cbe864a --- /dev/null +++ b/app/Console/Commands/SyncCardDavContactsCommand.php @@ -0,0 +1,32 @@ +sync(); + } catch (Throwable $exception) { + $this->error('Synchronisation CardDAV en echec : '.$exception->getMessage()); + + return self::FAILURE; + } + + $this->info((string) $run->message); + $this->line('Contacts lus : '.$run->fetched_contacts); + $this->line('Contacts synchronises : '.$run->synced_contacts); + $this->line('Contacts supprimes localement : '.$run->deleted_contacts); + + return self::SUCCESS; + } +} diff --git a/app/Contracts/Calendar/CalendarClientInterface.php b/app/Contracts/Calendar/CalendarClientInterface.php new file mode 100644 index 0000000..91984df --- /dev/null +++ b/app/Contracts/Calendar/CalendarClientInterface.php @@ -0,0 +1,14 @@ + + */ + public function fetchEvents(CarbonInterface $from, CarbonInterface $to): array; +} diff --git a/app/Contracts/CardDav/CardDavClientInterface.php b/app/Contracts/CardDav/CardDavClientInterface.php new file mode 100644 index 0000000..f62228d --- /dev/null +++ b/app/Contracts/CardDav/CardDavClientInterface.php @@ -0,0 +1,13 @@ + + */ + public function fetchCards(): array; +} diff --git a/app/Contracts/PhoneNumberNormalizerInterface.php b/app/Contracts/PhoneNumberNormalizerInterface.php new file mode 100644 index 0000000..b453746 --- /dev/null +++ b/app/Contracts/PhoneNumberNormalizerInterface.php @@ -0,0 +1,10 @@ +> $recipients + */ + public function send(SmsCampaign $campaign, array $recipients): SmsSendResult; +} diff --git a/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/app/Http/Controllers/Auth/AuthenticatedSessionController.php new file mode 100644 index 0000000..5da0b6e --- /dev/null +++ b/app/Http/Controllers/Auth/AuthenticatedSessionController.php @@ -0,0 +1,48 @@ +validate([ + 'email' => ['required', 'string', 'max:255'], + 'password' => ['required', 'string'], + ]); + + $remember = $request->boolean('remember'); + + if (! Auth::attempt($credentials, $remember)) { + throw ValidationException::withMessages([ + 'email' => __('auth.failed'), + ]); + } + + $request->session()->regenerate(); + + return redirect()->intended(route('recipients.index', absolute: false)); + } + + public function destroy(Request $request): RedirectResponse + { + Auth::guard('web')->logout(); + + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + return redirect()->route('login'); + } +} diff --git a/app/Http/Controllers/CardDavSyncController.php b/app/Http/Controllers/CardDavSyncController.php new file mode 100644 index 0000000..c60f52c --- /dev/null +++ b/app/Http/Controllers/CardDavSyncController.php @@ -0,0 +1,25 @@ +sync(); + } catch (Throwable $exception) { + return redirect() + ->route('contacts.index') + ->with('status', 'Synchronisation CardDAV en echec : '.$exception->getMessage()); + } + + return redirect() + ->route('contacts.index') + ->with('status', $run->message ?? 'Synchronisation CardDAV terminee.'); + } +} diff --git a/app/Http/Controllers/ContactController.php b/app/Http/Controllers/ContactController.php new file mode 100644 index 0000000..7660bcf --- /dev/null +++ b/app/Http/Controllers/ContactController.php @@ -0,0 +1,287 @@ +query('q', ''); + $groupId = $request->integer('group'); + $favoriteOnly = $request->boolean('favorite'); + $selectedStatus = (string) $request->query('status', ''); + $selectedMobileFilter = (string) $request->query('mobile', 'detected'); + + if (! in_array($selectedStatus, ['', 'active', 'favorite', 'opt_out'], true)) { + $selectedStatus = ''; + } + + if (! in_array($selectedMobileFilter, ['all', 'detected', 'non_mobile', 'invalid', 'missing'], true)) { + $selectedMobileFilter = 'detected'; + } + + $contacts = Contact::query() + ->with(['groups', 'phoneNumbers']) + ->withCount('groups') + ->search($search) + ->when($groupId > 0, function ($query) use ($groupId): void { + $query->whereHas('groups', fn ($query) => $query->whereKey($groupId)); + }) + ->when($favoriteOnly || $selectedStatus === 'favorite', function ($query): void { + $query->where('is_favorite', true); + }) + ->when($selectedStatus === 'opt_out', function ($query): void { + $query->where('sms_opt_out', true); + }) + ->when($selectedStatus === 'active', function ($query): void { + $query->where('sms_opt_out', false); + }) + ->when($selectedMobileFilter === 'detected', function ($query): void { + $query->whereHas('phoneNumbers', function ($query): void { + $query->where('is_valid', true) + ->where(function ($query): void { + $query + ->where('is_mobile', true) + ->orWhere('normalized_number', 'like', '+336%') + ->orWhere('normalized_number', 'like', '+337%'); + }); + }); + }) + ->when($selectedMobileFilter === 'non_mobile', function ($query): void { + $query->whereHas('phoneNumbers', function ($query): void { + $query->where('is_valid', true) + ->where('is_mobile', false) + ->where('normalized_number', 'not like', '+336%') + ->where('normalized_number', 'not like', '+337%'); + }); + }) + ->when($selectedMobileFilter === 'invalid', function ($query): void { + $query->whereHas('phoneNumbers', fn ($query) => $query->where('is_valid', false)); + }) + ->when($selectedMobileFilter === 'missing', function ($query): void { + $query->whereDoesntHave('phoneNumbers'); + }) + ->orderByDesc('is_favorite') + ->orderBy('last_name') + ->orderBy('first_name') + ->paginate(15) + ->withQueryString(); + + $groups = ContactGroup::query() + ->withCount('contacts') + ->orderBy('name') + ->get(); + + return view('contacts.index', [ + 'contacts' => $contacts, + 'groups' => $groups, + 'search' => $search, + 'selectedGroupId' => $groupId, + 'favoriteOnly' => $favoriteOnly, + 'selectedStatus' => $selectedStatus, + 'selectedMobileFilter' => $selectedMobileFilter, + 'cardDavSyncEnabled' => (bool) config('relais_sms.default_settings.carddav_sync_enabled'), + 'lastCardDavSyncRun' => SourceSyncRun::query() + ->where('source', 'carddav') + ->latest('started_at') + ->first(), + ]); + } + + public function create(): View + { + return view('contacts.create', [ + 'groups' => ContactGroup::query()->where('source', 'local')->orderBy('name')->get(), + ]); + } + + public function store(Request $request, PhoneNumberNormalizerInterface $normalizer): RedirectResponse + { + $validated = $request->validate($this->rules()); + + $contact = DB::transaction(function () use ($request, $validated, $normalizer): Contact { + $contact = Contact::query()->create([ + 'source' => 'local', + 'first_name' => $validated['first_name'] ?? null, + 'last_name' => $validated['last_name'], + 'organization' => $validated['organization'] ?? null, + 'email' => $validated['email'] ?? null, + 'notes' => $validated['notes'] ?? null, + 'sms_opt_out' => $request->boolean('sms_opt_out'), + 'is_favorite' => $request->boolean('is_favorite'), + ]); + + $contact->groups()->sync($validated['group_ids'] ?? []); + $this->syncPrimaryPhoneNumber($contact, $validated, $normalizer); + + return $contact; + }); + + return redirect() + ->route('contacts.show', $contact) + ->with('status', 'Contact cree.'); + } + + public function show(Contact $contact): View + { + $contact->load(['groups', 'phoneNumbers']); + + return view('contacts.show', [ + 'contact' => $contact, + ]); + } + + public function favorite(Request $request, Contact $contact): RedirectResponse + { + $validated = $request->validate([ + 'is_favorite' => ['required', 'boolean'], + ]); + + $contact->update([ + 'is_favorite' => (bool) $validated['is_favorite'], + ]); + + return back()->with('status', $contact->is_favorite ? 'Contact ajoute aux favoris.' : 'Contact retire des favoris.'); + } + + public function optOut(Request $request, Contact $contact): RedirectResponse + { + $validated = $request->validate([ + 'sms_opt_out' => ['required', 'boolean'], + ]); + + $contact->update([ + 'sms_opt_out' => (bool) $validated['sms_opt_out'], + ]); + + return back()->with('status', $contact->sms_opt_out ? 'Contact ajoute aux refus SMS.' : 'Contact retire des refus SMS.'); + } + + public function edit(Contact $contact): View + { + $this->ensureLocalContact($contact); + + $contact->load(['groups', 'phoneNumbers']); + + return view('contacts.edit', [ + 'contact' => $contact, + 'groups' => ContactGroup::query()->where('source', 'local')->orderBy('name')->get(), + 'primaryPhone' => $contact->phoneNumbers->firstWhere('is_primary', true) ?? $contact->phoneNumbers->first(), + ]); + } + + public function update(Request $request, Contact $contact, PhoneNumberNormalizerInterface $normalizer): RedirectResponse + { + $this->ensureLocalContact($contact); + + $validated = $request->validate($this->rules()); + + DB::transaction(function () use ($request, $contact, $validated, $normalizer): void { + $contact->update([ + 'first_name' => $validated['first_name'] ?? null, + 'last_name' => $validated['last_name'], + 'organization' => $validated['organization'] ?? null, + 'email' => $validated['email'] ?? null, + 'notes' => $validated['notes'] ?? null, + 'sms_opt_out' => $request->boolean('sms_opt_out'), + 'is_favorite' => $request->boolean('is_favorite'), + ]); + + $contact->groups()->sync($validated['group_ids'] ?? []); + $this->syncPrimaryPhoneNumber($contact, $validated, $normalizer); + }); + + return redirect() + ->route('contacts.show', $contact) + ->with('status', 'Contact modifie.'); + } + + public function destroy(Contact $contact): RedirectResponse + { + $this->ensureLocalContact($contact); + + $contact->delete(); + + return redirect() + ->route('contacts.index') + ->with('status', 'Contact supprime.'); + } + + /** + * @return array> + */ + private function rules(): array + { + return [ + 'first_name' => ['nullable', 'string', 'max:255'], + 'last_name' => ['required', 'string', 'max:255'], + 'organization' => ['nullable', 'string', 'max:255'], + 'email' => ['nullable', 'email', 'max:255'], + 'notes' => ['nullable', 'string'], + 'phone_label' => ['nullable', 'string', 'max:255'], + 'raw_phone_number' => ['nullable', 'string', 'max:255'], + 'group_ids' => ['array'], + 'group_ids.*' => [ + 'integer', + Rule::exists('contact_groups', 'id') + ->where('source', 'local') + ->whereNull('deleted_at'), + ], + ]; + } + + private function ensureLocalContact(Contact $contact): void + { + abort_if($contact->source !== 'local', 403, 'Les contacts importes ne sont pas modifiables localement.'); + } + + /** + * @param array $validated + */ + private function syncPrimaryPhoneNumber(Contact $contact, array $validated, PhoneNumberNormalizerInterface $normalizer): void + { + $rawPhoneNumber = trim((string) ($validated['raw_phone_number'] ?? '')); + $primaryPhone = $contact->phoneNumbers()->where('is_primary', true)->first() + ?? $contact->phoneNumbers()->first(); + + if ($rawPhoneNumber === '') { + $primaryPhone?->delete(); + + return; + } + + $result = $normalizer->normalize( + $rawPhoneNumber, + (string) config('relais_sms.default_settings.default_country'), + ); + + $attributes = [ + 'label' => $validated['phone_label'] ?? null, + 'raw_number' => $result->rawNumber, + 'normalized_number' => $result->normalizedNumber, + 'country' => $result->country, + 'is_valid' => $result->isValid, + 'is_mobile' => $result->isMobile, + 'is_primary' => true, + 'validation_error' => $result->error, + ]; + + if ($primaryPhone) { + $primaryPhone->update($attributes); + + return; + } + + $contact->phoneNumbers()->create($attributes); + } +} diff --git a/app/Http/Controllers/ContactGroupController.php b/app/Http/Controllers/ContactGroupController.php new file mode 100644 index 0000000..7f884dc --- /dev/null +++ b/app/Http/Controllers/ContactGroupController.php @@ -0,0 +1,117 @@ +validate([ + 'name' => ['required', 'string', 'max:255', Rule::unique('contact_groups', 'name')->whereNull('deleted_at')], + 'description' => ['nullable', 'string'], + ]); + + ContactGroup::query()->create([ + 'source' => 'local', + 'name' => $validated['name'], + 'slug' => $this->uniqueSlug($validated['name']), + 'description' => $validated['description'] ?? null, + 'is_favorite' => $request->boolean('is_favorite'), + ]); + + return redirect() + ->route('contacts.index') + ->with('status', 'Groupe cree.'); + } + + public function edit(ContactGroup $contactGroup): View + { + $this->ensureLocalGroup($contactGroup); + + return view('contact-groups.edit', [ + 'group' => $contactGroup->load('contacts')->loadCount('contacts'), + 'contacts' => Contact::query() + ->with('phoneNumbers') + ->orderBy('last_name') + ->orderBy('first_name') + ->get(), + 'selectedContactIds' => $contactGroup->contacts->pluck('id')->all(), + ]); + } + + public function update(Request $request, ContactGroup $contactGroup): RedirectResponse + { + $this->ensureLocalGroup($contactGroup); + + $validated = $request->validate([ + 'name' => [ + 'required', + 'string', + 'max:255', + Rule::unique('contact_groups', 'name')->ignore($contactGroup)->whereNull('deleted_at'), + ], + 'description' => ['nullable', 'string'], + 'contact_ids' => ['array'], + 'contact_ids.*' => [Rule::exists('contacts', 'id')->whereNull('deleted_at')], + ]); + + $contactGroup->update([ + 'name' => $validated['name'], + 'slug' => $this->uniqueSlug($validated['name'], $contactGroup), + 'description' => $validated['description'] ?? null, + 'is_favorite' => $request->boolean('is_favorite'), + ]); + + if ($request->has('members_submitted')) { + $contactGroup->contacts()->sync($validated['contact_ids'] ?? []); + } + + return redirect() + ->route('contacts.index', ['group' => $contactGroup->id]) + ->with('status', 'Groupe modifie.'); + } + + public function destroy(ContactGroup $contactGroup): RedirectResponse + { + $this->ensureLocalGroup($contactGroup); + + $contactGroup->contacts()->detach(); + $contactGroup->delete(); + + return redirect() + ->route('contacts.index') + ->with('status', 'Groupe supprime.'); + } + + private function uniqueSlug(string $name, ?ContactGroup $ignore = null): string + { + $baseSlug = Str::slug($name); + $baseSlug = $baseSlug === '' ? 'groupe' : $baseSlug; + $slug = $baseSlug; + $index = 2; + + while (ContactGroup::query() + ->where('slug', $slug) + ->when($ignore, fn ($query) => $query->whereKeyNot($ignore->id)) + ->exists() + ) { + $slug = $baseSlug.'-'.$index; + $index++; + } + + return $slug; + } + + private function ensureLocalGroup(ContactGroup $contactGroup): void + { + abort_if($contactGroup->source !== 'local', 403, 'Les groupes importes ne sont pas modifiables localement.'); + } +} diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php new file mode 100644 index 0000000..8677cd5 --- /dev/null +++ b/app/Http/Controllers/Controller.php @@ -0,0 +1,8 @@ +query('token') ?: $request->header('X-RelaisSMS-Callback-Token', ''))); + + abort_if($configuredToken === '' || ! hash_equals($configuredToken, $receivedToken), 403); + + $sender = $this->sender($request); + + if ($sender === '') { + return response()->json([ + 'status' => 'ignored', + 'reason' => 'missing_sender', + ], 422); + } + + $result = $normalizer->normalize( + $sender, + (string) config('relais_sms.default_settings.default_country'), + ); + + if (! $result->isValid || $result->normalizedNumber === null) { + return response()->json([ + 'status' => 'ignored', + 'reason' => 'invalid_sender', + ], 422); + } + + $contacts = ContactPhoneNumber::query() + ->with('contact') + ->where('normalized_number', $result->normalizedNumber) + ->get() + ->pluck('contact') + ->filter() + ->unique('id') + ->values(); + + $updatedContacts = 0; + $alreadyOptedOutContacts = 0; + + foreach ($contacts as $contact) { + if ($contact->sms_opt_out) { + $alreadyOptedOutContacts++; + + continue; + } + + $contact->update(['sms_opt_out' => true]); + $updatedContacts++; + } + + return response()->json([ + 'status' => $contacts->isEmpty() ? 'unmatched' : 'ok', + 'sender' => $result->normalizedNumber, + 'updated_contacts' => $updatedContacts, + 'already_opted_out_contacts' => $alreadyOptedOutContacts, + ]); + } + + private function sender(Request $request): string + { + foreach (['sender', 'from', 'number', 'phone', 'msisdn'] as $key) { + $value = $request->input($key); + + if (is_string($value) && trim($value) !== '') { + return trim($value); + } + } + + return ''; + } +} diff --git a/app/Http/Controllers/RecipientSelectionController.php b/app/Http/Controllers/RecipientSelectionController.php new file mode 100644 index 0000000..c25be2f --- /dev/null +++ b/app/Http/Controllers/RecipientSelectionController.php @@ -0,0 +1,186 @@ +view($request, messageComposer: $messageComposer); + } + + public function search(Request $request): JsonResponse + { + $search = trim((string) $request->query('q', '')); + $like = '%'.str_replace(['%', '_'], ['\%', '\_'], $search).'%'; + + $contacts = Contact::query() + ->with('phoneNumbers') + ->search($search) + ->orderByDesc('is_favorite') + ->orderBy('last_name') + ->orderBy('first_name') + ->limit(10) + ->get() + ->map(function (Contact $contact): array { + $primaryPhone = $contact->phoneNumbers->firstWhere('is_primary', true) + ?? $contact->phoneNumbers->first(); + + return [ + 'type' => 'contact', + 'id' => $contact->id, + 'label' => $contact->displayName(), + 'meta' => $primaryPhone?->normalized_number + ?: $primaryPhone?->raw_number + ?: $contact->email + ?: ucfirst($contact->source), + 'source' => $contact->source, + 'is_favorite' => $contact->is_favorite, + ]; + }); + + $groups = ContactGroup::query() + ->withCount('contacts') + ->when($search !== '', function ($query) use ($like): void { + $query->where(function ($query) use ($like): void { + $query + ->where('name', 'like', $like) + ->orWhere('description', 'like', $like); + }); + }) + ->orderByDesc('is_favorite') + ->orderBy('name') + ->limit(10) + ->get() + ->map(fn (ContactGroup $group): array => [ + 'type' => 'group', + 'id' => $group->id, + 'label' => $group->name, + 'meta' => $group->contacts_count.' contact(s)', + 'source' => $group->source, + 'is_favorite' => $group->is_favorite, + ]); + + return response()->json([ + 'results' => $groups->concat($contacts)->values(), + ]); + } + + public function preview(Request $request, RecipientResolver $resolver, SmsMessageComposer $messageComposer): View|RedirectResponse + { + $validated = $request->validate([ + 'q' => ['nullable', 'string', 'max:255'], + 'message' => ['nullable', 'string', 'max:612'], + 'include_sms_header' => ['nullable', 'boolean'], + 'include_sms_footer' => ['nullable', 'boolean'], + 'contact_ids' => ['array'], + 'contact_ids.*' => ['integer', Rule::exists('contacts', 'id')->whereNull('deleted_at')], + 'group_ids' => ['array'], + 'group_ids.*' => ['integer', Rule::exists('contact_groups', 'id')->whereNull('deleted_at')], + ]); + + $contactIds = $validated['contact_ids'] ?? []; + $groupIds = $validated['group_ids'] ?? []; + + if ($contactIds === [] && $groupIds === []) { + return redirect() + ->route('recipients.index', ['q' => $validated['q'] ?? null]) + ->withErrors(['selection' => 'Selectionnez au moins un contact ou un groupe.']) + ->withInput(); + } + + return $this->view( + $request, + $resolver->resolve($contactIds, $groupIds), + $contactIds, + $groupIds, + $messageComposer, + ); + } + + /** + * @param array $selectedContactIds + * @param array $selectedGroupIds + */ + private function view( + Request $request, + ?RecipientResolutionResult $resolution = null, + array $selectedContactIds = [], + array $selectedGroupIds = [], + ?SmsMessageComposer $messageComposer = null, + ): View { + $messageComposer ??= app(SmsMessageComposer::class); + $messageSettings = $messageComposer->settings(); + $oldHeaderChoice = $request->old('include_sms_header'); + $oldFooterChoice = $request->old('include_sms_footer'); + $hasHeaderChoice = $oldHeaderChoice !== null || $request->has('include_sms_header'); + $hasFooterChoice = $oldFooterChoice !== null || $request->has('include_sms_footer'); + $includeHeader = $hasHeaderChoice + ? filter_var($oldHeaderChoice ?? $request->input('include_sms_header'), FILTER_VALIDATE_BOOLEAN) + : $messageSettings['header'] !== ''; + $includeFooter = $hasFooterChoice + ? filter_var($oldFooterChoice ?? $request->input('include_sms_footer'), FILTER_VALIDATE_BOOLEAN) + : $messageSettings['footer'] !== ''; + $messageBody = (string) $request->old('message', $request->input('message', '')); + + $search = trim((string) $request->input('q', '')); + $like = '%'.str_replace(['%', '_'], ['\%', '\_'], $search).'%'; + + $contacts = Contact::query() + ->with(['groups', 'phoneNumbers']) + ->search($search) + ->orderByDesc('is_favorite') + ->orderBy('last_name') + ->orderBy('first_name') + ->limit(50) + ->get(); + + $groups = ContactGroup::query() + ->withCount('contacts') + ->when($search !== '', function ($query) use ($like): void { + $query->where(function ($query) use ($like): void { + $query + ->where('name', 'like', $like) + ->orWhere('description', 'like', $like); + }); + }) + ->orderByDesc('is_favorite') + ->orderBy('name') + ->limit(50) + ->get(); + + return view('recipients.index', [ + 'contacts' => $contacts, + 'groups' => $groups, + 'search' => $search, + 'selectedContactIds' => collect($selectedContactIds)->map(fn (int|string $id): int => (int) $id)->all(), + 'selectedGroupIds' => collect($selectedGroupIds)->map(fn (int|string $id): int => (int) $id)->all(), + 'selectedContacts' => Contact::query() + ->whereKey($selectedContactIds) + ->orderBy('last_name') + ->orderBy('first_name') + ->get(), + 'selectedGroups' => ContactGroup::query() + ->whereKey($selectedGroupIds) + ->orderBy('name') + ->get(), + 'resolution' => $resolution, + 'smsHeader' => $messageSettings['header'], + 'smsFooter' => $messageSettings['footer'], + 'includeSmsHeader' => $includeHeader, + 'includeSmsFooter' => $includeFooter, + 'composedMessage' => $messageComposer->compose($messageBody, $includeHeader, $includeFooter), + ]); + } +} diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php new file mode 100644 index 0000000..e765a95 --- /dev/null +++ b/app/Http/Controllers/SettingsController.php @@ -0,0 +1,34 @@ + AppSetting::string('sms_message_header'), + 'smsFooter' => AppSetting::string('sms_message_footer'), + ]); + } + + public function update(Request $request): RedirectResponse + { + $validated = $request->validate([ + 'sms_message_header' => ['nullable', 'string', 'max:612'], + 'sms_message_footer' => ['nullable', 'string', 'max:612'], + ]); + + AppSetting::putString('sms_message_header', trim((string) ($validated['sms_message_header'] ?? ''))); + AppSetting::putString('sms_message_footer', trim((string) ($validated['sms_message_footer'] ?? ''))); + + return redirect() + ->route('settings.edit') + ->with('status', 'Parametres enregistres.'); + } +} diff --git a/app/Http/Controllers/SmsCampaignController.php b/app/Http/Controllers/SmsCampaignController.php new file mode 100644 index 0000000..b4fc22d --- /dev/null +++ b/app/Http/Controllers/SmsCampaignController.php @@ -0,0 +1,287 @@ + 'Brouillon', + 'scheduled' => 'Programme', + 'sending' => 'Envoi', + 'uncertain' => 'A verifier', + 'sent' => 'Envoye', + 'partial' => 'Partiel', + 'failed' => 'Echec', + 'canceled' => 'Annule', + ]; + + public function index(Request $request): View + { + $filters = $this->validateFilters($request); + + return view('sms-campaigns.index', [ + 'campaigns' => $this->filteredCampaignsQuery($filters) + ->latest() + ->paginate(20) + ->withQueryString(), + 'filters' => $filters, + 'groups' => ContactGroup::query()->orderBy('name')->get(['id', 'name']), + 'statuses' => self::STATUSES, + 'users' => User::query()->orderBy('name')->get(['id', 'name']), + ]); + } + + public function show(SmsCampaign $smsCampaign): View + { + return view('sms-campaigns.show', [ + 'campaign' => $smsCampaign->load(['deliveries' => fn ($query) => $query->orderBy('id'), 'user']), + ]); + } + + public function export(Request $request): StreamedResponse + { + $filters = $this->validateFilters($request); + $query = $this->filteredCampaignsQuery($filters) + ->with(['deliveries' => fn ($query) => $query->orderBy('id')]) + ->latest(); + + return response()->streamDownload(function () use ($query): void { + $csv = fopen('php://output', 'w'); + + fputcsv($csv, [ + 'campagne_id', + 'date_creation', + 'date_programmee', + 'date_envoi', + 'utilisateur', + 'statut_campagne', + 'groupes_selectionnes', + 'message', + 'destinataires_prevus', + 'destinataires_envoyes', + 'destinataires_echoues', + 'contact', + 'numero', + 'statut_destinataire', + 'message_fournisseur_id', + 'erreur', + ], ';'); + + $query->chunk(100, function ($campaigns) use ($csv): void { + foreach ($campaigns as $campaign) { + foreach ($campaign->deliveries as $delivery) { + fputcsv($csv, [ + $campaign->id, + $campaign->created_at->format('Y-m-d H:i:s'), + $campaign->scheduled_at?->format('Y-m-d H:i:s'), + $campaign->sent_at?->format('Y-m-d H:i:s'), + $campaign->user?->name ?: 'Utilisateur supprime', + self::STATUSES[$campaign->status] ?? $campaign->status, + implode(', ', $campaign->selected_group_names ?? []), + $campaign->message, + $campaign->recipients_count, + $campaign->sent_count, + $campaign->failed_count, + $delivery->contact_name, + $delivery->number, + $delivery->status, + $delivery->provider_message_id, + $delivery->error_message, + ], ';'); + } + } + }); + }, 'historique-sms-'.now()->format('Ymd-His').'.csv', [ + 'Content-Type' => 'text/csv; charset=UTF-8', + ]); + } + + public function store( + Request $request, + RecipientResolver $resolver, + SmsCampaignSender $sender, + SmsMessageComposer $messageComposer, + ): RedirectResponse { + $validated = $request->validate([ + 'message' => ['required', 'string', 'min:1', 'max:612'], + 'include_sms_header' => ['nullable', 'boolean'], + 'include_sms_footer' => ['nullable', 'boolean'], + 'contact_ids' => ['array'], + 'contact_ids.*' => ['integer', Rule::exists('contacts', 'id')->whereNull('deleted_at')], + 'group_ids' => ['array'], + 'group_ids.*' => ['integer', Rule::exists('contact_groups', 'id')->whereNull('deleted_at')], + 'send_mode' => ['nullable', Rule::in(['now', 'scheduled'])], + 'scheduled_at' => ['nullable', 'date'], + ]); + + $contactIds = $validated['contact_ids'] ?? []; + $groupIds = $validated['group_ids'] ?? []; + $resolution = $resolver->resolve($contactIds, $groupIds); + $recipients = $resolution->recipients; + $maxRecipients = (int) config('relais_sms.default_settings.max_sms_per_campaign', 100); + $messageSettings = $messageComposer->settings(); + $message = $messageComposer->compose( + (string) $validated['message'], + $request->has('include_sms_header') ? $request->boolean('include_sms_header') : $messageSettings['header'] !== '', + $request->has('include_sms_footer') ? $request->boolean('include_sms_footer') : $messageSettings['footer'] !== '', + ); + + if ($recipients === []) { + return redirect() + ->route('recipients.index') + ->withErrors(['selection' => 'Aucun numero valide a envoyer.']) + ->withInput(); + } + + if (mb_strlen($message) > 612) { + return redirect() + ->route('recipients.index') + ->withErrors(['message' => 'Le message complet avec entete et pied depasse 612 caracteres.']) + ->withInput(); + } + + if (count($recipients) > $maxRecipients) { + return redirect() + ->route('recipients.index') + ->withErrors(['selection' => 'La selection depasse la limite de '.$maxRecipients.' SMS.']) + ->withInput(); + } + + if (($validated['send_mode'] ?? 'now') === 'scheduled') { + if (! (bool) config('relais_sms.default_settings.scheduled_sends_enabled', true)) { + return redirect() + ->route('recipients.index') + ->withErrors(['scheduled_at' => 'Les envois programmes sont desactives.']) + ->withInput(); + } + + if (($validated['scheduled_at'] ?? null) === null) { + return redirect() + ->route('recipients.index') + ->withErrors(['scheduled_at' => 'La date et l heure d envoi sont obligatoires pour programmer un SMS.']) + ->withInput(); + } + + $scheduledAt = Carbon::parse((string) $validated['scheduled_at'], $this->scheduledTimezone())->utc(); + + if ($scheduledAt->lte(now())) { + return redirect() + ->route('recipients.index') + ->withErrors(['scheduled_at' => 'La date et l heure d envoi doivent etre futures.']) + ->withInput(); + } + + $campaign = $sender->schedule($request->user(), $message, $recipients, $contactIds, $groupIds, $scheduledAt); + + return redirect() + ->route('sms-campaigns.show', $campaign) + ->with('status', 'Campagne programmee pour le '.$campaign->scheduled_at?->timezone($this->scheduledTimezone())->format('d/m/Y H:i').'.'); + } + + $campaign = $sender->send($request->user(), $message, $recipients, $contactIds, $groupIds); + + if ($campaign->status === 'uncertain') { + return redirect()->route('sms-campaigns.show', $campaign)->with('status', $campaign->error_message); + } + + return redirect() + ->route('sms-campaigns.show', $campaign) + ->with( + $campaign->status === 'failed' ? 'error' : 'status', + $campaign->status === 'failed' + ? 'Envoi refuse ou echoue : '.$campaign->error_message + : 'Campagne envoyee a '.$campaign->sent_count.' destinataire(s).', + ); + } + + public function cancel(SmsCampaign $smsCampaign): RedirectResponse + { + $canceled = DB::transaction(function () use ($smsCampaign): bool { + $campaign = SmsCampaign::query() + ->whereKey($smsCampaign->id) + ->lockForUpdate() + ->first(); + + if (! $campaign || $campaign->status !== 'scheduled') { + return false; + } + + $campaign->update([ + 'status' => 'canceled', + 'canceled_at' => now(), + ]); + + $campaign->deliveries() + ->where('status', 'queued') + ->update(['status' => 'canceled']); + + return true; + }); + + return redirect() + ->route('sms-campaigns.show', $smsCampaign) + ->with( + $canceled ? 'status' : 'error', + $canceled + ? 'Campagne programmee annulee.' + : 'Cette campagne ne peut plus etre annulee.', + ); + } + + /** + * @return array{from?: string|null, to?: string|null, status?: string|null, user_id?: string|null, group_id?: string|null} + */ + private function validateFilters(Request $request): array + { + return $request->validate([ + 'from' => ['nullable', 'date'], + 'to' => ['nullable', 'date'], + 'status' => ['nullable', Rule::in(array_keys(self::STATUSES))], + 'user_id' => ['nullable', 'integer', Rule::exists('users', 'id')], + 'group_id' => ['nullable', 'integer', Rule::exists('contact_groups', 'id')->whereNull('deleted_at')], + ]); + } + + /** + * @param array{from?: string|null, to?: string|null, status?: string|null, user_id?: string|null, group_id?: string|null} $filters + * @return Builder + */ + private function filteredCampaignsQuery(array $filters): Builder + { + return SmsCampaign::query() + ->with('user') + ->when($filters['from'] ?? null, fn (Builder $query, string $date): Builder => $query->whereDate('created_at', '>=', $date)) + ->when($filters['to'] ?? null, fn (Builder $query, string $date): Builder => $query->whereDate('created_at', '<=', $date)) + ->when($filters['status'] ?? null, fn (Builder $query, string $status): Builder => $query->where('status', $status)) + ->when($filters['user_id'] ?? null, fn (Builder $query, string $userId): Builder => $query->where('user_id', (int) $userId)) + ->when($filters['group_id'] ?? null, function (Builder $query, string $groupId): Builder { + $groupId = (int) $groupId; + + return $query->where(function (Builder $query) use ($groupId): void { + $query + ->whereJsonContains('selected_group_ids', $groupId) + ->orWhereHas('deliveries.contact.groups', fn (Builder $query): Builder => $query->where('contact_groups.id', $groupId)); + }); + }); + } + + private function scheduledTimezone(): string + { + return (string) config('relais_sms.default_settings.display_timezone', 'Europe/Paris'); + } +} diff --git a/app/Models/AppSetting.php b/app/Models/AppSetting.php new file mode 100644 index 0000000..9a8f6b7 --- /dev/null +++ b/app/Models/AppSetting.php @@ -0,0 +1,34 @@ +where('key', $key)->first(); + + if ($setting === null) { + $configured = config('relais_sms.default_settings.'.$key); + + return is_string($configured) ? $configured : $default; + } + + return (string) $setting->value; + } + + public static function putString(string $key, string $value): void + { + self::query()->updateOrCreate( + ['key' => $key], + [ + 'value' => $value, + 'type' => 'string', + ], + ); + } +} diff --git a/app/Models/CalendarEvent.php b/app/Models/CalendarEvent.php new file mode 100644 index 0000000..050204d --- /dev/null +++ b/app/Models/CalendarEvent.php @@ -0,0 +1,43 @@ + + */ + public function reminders(): HasMany + { + return $this->hasMany(CalendarReminder::class); + } + + protected function casts(): array + { + return [ + 'starts_at' => 'datetime', + 'ends_at' => 'datetime', + 'attendees' => 'array', + 'synced_at' => 'datetime', + 'deleted_at' => 'datetime', + ]; + } +} diff --git a/app/Models/CalendarReminder.php b/app/Models/CalendarReminder.php new file mode 100644 index 0000000..ecbb6cb --- /dev/null +++ b/app/Models/CalendarReminder.php @@ -0,0 +1,45 @@ + + */ + public function event(): BelongsTo + { + return $this->belongsTo(CalendarEvent::class, 'calendar_event_id'); + } + + /** + * @return BelongsTo + */ + public function smsCampaign(): BelongsTo + { + return $this->belongsTo(SmsCampaign::class); + } + + protected function casts(): array + { + return [ + 'remind_at' => 'datetime', + 'sent_at' => 'datetime', + ]; + } +} diff --git a/app/Models/Contact.php b/app/Models/Contact.php new file mode 100644 index 0000000..31631e9 --- /dev/null +++ b/app/Models/Contact.php @@ -0,0 +1,94 @@ + + */ + public function phoneNumbers(): HasMany + { + return $this->hasMany(ContactPhoneNumber::class); + } + + /** + * @return BelongsToMany + */ + public function groups(): BelongsToMany + { + return $this->belongsToMany(ContactGroup::class, 'contact_contact_group') + ->withTimestamps(); + } + + public function displayName(): string + { + return trim(implode(' ', array_filter([$this->first_name, $this->last_name]))); + } + + /** + * @param Builder $query + */ + #[Scope] + protected function search(Builder $query, ?string $term): void + { + $term = trim((string) $term); + + if ($term === '') { + return; + } + + $like = '%'.str_replace(['%', '_'], ['\%', '\_'], $term).'%'; + + $query->where(function (Builder $query) use ($like): void { + $query + ->where('first_name', 'like', $like) + ->orWhere('last_name', 'like', $like) + ->orWhere('organization', 'like', $like) + ->orWhere('email', 'like', $like) + ->orWhereHas('phoneNumbers', function (Builder $query) use ($like): void { + $query + ->where('raw_number', 'like', $like) + ->orWhere('normalized_number', 'like', $like); + }); + }); + } + + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + 'sms_opt_out' => 'boolean', + 'is_favorite' => 'boolean', + 'synced_at' => 'datetime', + ]; + } +} diff --git a/app/Models/ContactGroup.php b/app/Models/ContactGroup.php new file mode 100644 index 0000000..2aabf7e --- /dev/null +++ b/app/Models/ContactGroup.php @@ -0,0 +1,44 @@ + + */ + public function contacts(): BelongsToMany + { + return $this->belongsToMany(Contact::class, 'contact_contact_group') + ->withTimestamps(); + } + + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + 'is_favorite' => 'boolean', + 'synced_at' => 'datetime', + ]; + } +} diff --git a/app/Models/ContactPhoneNumber.php b/app/Models/ContactPhoneNumber.php new file mode 100644 index 0000000..bfe8eb2 --- /dev/null +++ b/app/Models/ContactPhoneNumber.php @@ -0,0 +1,62 @@ +is_mobile) { + return true; + } + + $normalizedNumber = (string) $this->normalized_number; + + if (preg_match('/^\+33[67]\d{8}$/', $normalizedNumber) === 1) { + return true; + } + + $rawDigits = preg_replace('/\D+/', '', (string) $this->raw_number) ?? ''; + + return preg_match('/^0[67]\d{8}$/', $rawDigits) === 1 + || preg_match('/^33[67]\d{8}$/', $rawDigits) === 1 + || preg_match('/^0033[67]\d{8}$/', $rawDigits) === 1; + } + + /** + * @return BelongsTo + */ + public function contact(): BelongsTo + { + return $this->belongsTo(Contact::class); + } + + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + 'is_valid' => 'boolean', + 'is_mobile' => 'boolean', + 'is_primary' => 'boolean', + ]; + } +} diff --git a/app/Models/SmsCampaign.php b/app/Models/SmsCampaign.php new file mode 100644 index 0000000..182888b --- /dev/null +++ b/app/Models/SmsCampaign.php @@ -0,0 +1,62 @@ + + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } + + /** + * @return HasMany + */ + public function deliveries(): HasMany + { + return $this->hasMany(SmsDelivery::class); + } + + protected function casts(): array + { + return [ + 'request_payload' => 'array', + 'response_payload' => 'array', + 'selected_contact_ids' => 'array', + 'selected_group_ids' => 'array', + 'selected_group_names' => 'array', + 'scheduled_at' => 'datetime', + 'sent_at' => 'datetime', + 'canceled_at' => 'datetime', + ]; + } +} diff --git a/app/Models/SmsDelivery.php b/app/Models/SmsDelivery.php new file mode 100644 index 0000000..acdb901 --- /dev/null +++ b/app/Models/SmsDelivery.php @@ -0,0 +1,54 @@ + + */ + public function campaign(): BelongsTo + { + return $this->belongsTo(SmsCampaign::class, 'sms_campaign_id'); + } + + /** + * @return BelongsTo + */ + public function contact(): BelongsTo + { + return $this->belongsTo(Contact::class); + } + + /** + * @return BelongsTo + */ + public function phoneNumber(): BelongsTo + { + return $this->belongsTo(ContactPhoneNumber::class, 'contact_phone_number_id'); + } + + protected function casts(): array + { + return [ + 'provider_response' => 'array', + 'sent_at' => 'datetime', + ]; + } +} diff --git a/app/Models/SourceSyncRun.php b/app/Models/SourceSyncRun.php new file mode 100644 index 0000000..ea0aea7 --- /dev/null +++ b/app/Models/SourceSyncRun.php @@ -0,0 +1,33 @@ + + */ + protected function casts(): array + { + return [ + 'started_at' => 'datetime', + 'finished_at' => 'datetime', + ]; + } +} diff --git a/app/Models/User.php b/app/Models/User.php new file mode 100644 index 0000000..f6ba1d2 --- /dev/null +++ b/app/Models/User.php @@ -0,0 +1,32 @@ + */ + use HasFactory, Notifiable; + + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + 'email_verified_at' => 'datetime', + 'password' => 'hashed', + ]; + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php new file mode 100644 index 0000000..54ef19e --- /dev/null +++ b/app/Providers/AppServiceProvider.php @@ -0,0 +1,40 @@ +app->singleton(PhoneNumberUtil::class, fn (): PhoneNumberUtil => PhoneNumberUtil::getInstance()); + $this->app->bind(PhoneNumberNormalizerInterface::class, LibPhoneNumberNormalizer::class); + $this->app->singleton(ClientInterface::class, fn (): ClientInterface => new Client); + $this->app->bind(CardDavClientInterface::class, CardDavClient::class); + $this->app->bind(CalendarClientInterface::class, CalDavCalendarClient::class); + $this->app->bind(SmsProviderInterface::class, OvhSmsProvider::class); + } + + /** + * Bootstrap any application services. + */ + public function boot(): void + { + // + } +} diff --git a/app/Services/Calendar/CalDavCalendarClient.php b/app/Services/Calendar/CalDavCalendarClient.php new file mode 100644 index 0000000..b94bc78 --- /dev/null +++ b/app/Services/Calendar/CalDavCalendarClient.php @@ -0,0 +1,232 @@ + + */ + public function fetchEvents(CarbonInterface $from, CarbonInterface $to): array + { + try { + $events = $this->fetchEventsWithReport($from, $to); + + if ($events !== []) { + return $events; + } + } catch (GuzzleException|RuntimeException) { + // Some CalDAV servers restrict calendar-query. Fall back to PROPFIND + GET. + } + + return $this->fetchEventsWithPropfind(); + } + + /** + * @return array + */ + private function fetchEventsWithReport(CarbonInterface $from, CarbonInterface $to): array + { + $url = rtrim((string) config('relais_sms.caldav.url'), '/').'/'; + $username = (string) config('relais_sms.caldav.username'); + $password = (string) config('relais_sms.caldav.password'); + + $this->ensureConfigured($url, $username, $password); + + $response = $this->http->request('REPORT', $url, [ + 'auth' => [$username, $password], + 'headers' => [ + 'Content-Type' => 'application/xml; charset=utf-8', + 'Depth' => '1', + ], + 'body' => $this->calendarQueryBody($from, $to), + 'timeout' => (float) config('relais_sms.caldav.timeout'), + ]); + + return $this->parseReport((string) $response->getBody()); + } + + /** + * @return array + */ + private function fetchEventsWithPropfind(): array + { + $url = rtrim((string) config('relais_sms.caldav.url'), '/').'/'; + $username = (string) config('relais_sms.caldav.username'); + $password = (string) config('relais_sms.caldav.password'); + + $this->ensureConfigured($url, $username, $password); + + $response = $this->http->request('PROPFIND', $url, [ + 'auth' => [$username, $password], + 'headers' => [ + 'Content-Type' => 'application/xml; charset=utf-8', + 'Depth' => '1', + ], + 'body' => <<<'XML' + + + + + + +XML, + 'timeout' => (float) config('relais_sms.caldav.timeout'), + ]); + + $entries = $this->parsePropfind((string) $response->getBody(), $url); + $events = []; + + foreach ($entries as $entry) { + $eventResponse = $this->http->request('GET', $entry['url'], [ + 'auth' => [$username, $password], + 'headers' => [ + 'Accept' => 'text/calendar,text/plain,*/*', + ], + 'timeout' => (float) config('relais_sms.caldav.timeout'), + ]); + + $events[] = new CalendarRemoteEvent( + href: $entry['href'], + etag: $entry['etag'], + ical: (string) $eventResponse->getBody(), + ); + } + + return $events; + } + + private function ensureConfigured(string $url, string $username, string $password): void + { + if ($url === '/' || $username === '' || $password === '') { + throw new RuntimeException('Configuration CalDAV agenda incomplete.'); + } + } + + private function calendarQueryBody(CarbonInterface $from, CarbonInterface $to): string + { + $start = $from->copy()->utc()->format('Ymd\THis\Z'); + $end = $to->copy()->utc()->format('Ymd\THis\Z'); + + return << + + + + + + + + + + + + + +XML; + } + + /** + * @return array + */ + private function parseReport(string $xml): array + { + try { + $document = new SimpleXMLElement($xml); + } catch (Throwable $exception) { + throw new RuntimeException('Reponse CalDAV REPORT illisible.', previous: $exception); + } + + $document->registerXPathNamespace('d', 'DAV:'); + $responses = $document->xpath('//d:response') ?: []; + $events = []; + + foreach ($responses as $response) { + $response->registerXPathNamespace('d', 'DAV:'); + $response->registerXPathNamespace('c', 'urn:ietf:params:xml:ns:caldav'); + + $hrefNodes = $response->xpath('./d:href') ?: []; + $calendarDataNodes = $response->xpath('.//c:calendar-data') ?: []; + $href = trim((string) ($hrefNodes[0] ?? '')); + $ical = (string) ($calendarDataNodes[0] ?? ''); + + if ($href === '' || trim($ical) === '') { + continue; + } + + $etagNodes = $response->xpath('.//d:getetag') ?: []; + $events[] = new CalendarRemoteEvent( + href: $href, + etag: trim((string) ($etagNodes[0] ?? ''), '"') ?: null, + ical: $ical, + ); + } + + return $events; + } + + /** + * @return array + */ + private function parsePropfind(string $xml, string $baseUrl): array + { + try { + $document = new SimpleXMLElement($xml); + } catch (Throwable $exception) { + throw new RuntimeException('Reponse CalDAV PROPFIND illisible.', previous: $exception); + } + + $document->registerXPathNamespace('d', 'DAV:'); + $responses = $document->xpath('//d:response') ?: []; + $entries = []; + + foreach ($responses as $response) { + $response->registerXPathNamespace('d', 'DAV:'); + $hrefNodes = $response->xpath('./d:href') ?: []; + $href = trim((string) ($hrefNodes[0] ?? '')); + + if ($href === '' || ! str_ends_with(strtolower(parse_url($href, PHP_URL_PATH) ?: $href), '.ics')) { + continue; + } + + $etagNodes = $response->xpath('.//d:getetag') ?: []; + $entries[] = [ + 'href' => $href, + 'etag' => trim((string) ($etagNodes[0] ?? ''), '"') ?: null, + 'url' => $this->absoluteUrl($baseUrl, $href), + ]; + } + + return $entries; + } + + private function absoluteUrl(string $baseUrl, string $href): string + { + if (parse_url($href, PHP_URL_SCHEME)) { + return $href; + } + + $base = parse_url($baseUrl); + + if (! isset($base['scheme'], $base['host'])) { + throw new RuntimeException('URL CalDAV agenda invalide.'); + } + + $port = isset($base['port']) ? ':'.$base['port'] : ''; + $path = str_starts_with($href, '/') ? $href : rtrim((string) ($base['path'] ?? ''), '/').'/'.$href; + + return $base['scheme'].'://'.$base['host'].$port.$path; + } +} diff --git a/app/Services/Calendar/CalendarEventSyncService.php b/app/Services/Calendar/CalendarEventSyncService.php new file mode 100644 index 0000000..9b8cb97 --- /dev/null +++ b/app/Services/Calendar/CalendarEventSyncService.php @@ -0,0 +1,214 @@ +subDay(); + $to ??= Carbon::now()->addDays((int) config('relais_sms.caldav.lookahead_days', 90)); + + $run = SourceSyncRun::query()->create([ + 'source' => 'caldav_calendar', + 'status' => 'running', + 'started_at' => Carbon::now(), + ]); + + try { + $remoteEvents = $this->client->fetchEvents($from, $to); + + DB::transaction(function () use ($run, $remoteEvents, $from, $to): void { + $seenExternalIds = []; + $syncedEvents = 0; + $scheduledReminders = 0; + + foreach ($remoteEvents as $remoteEvent) { + foreach ($this->parser->parse($remoteEvent->ical, $from, $to) as $parsedEvent) { + $externalId = $parsedEvent->recurrenceId === null + ? $parsedEvent->uid + : 'recurrence:'.sha1($parsedEvent->uid.'|'.$parsedEvent->recurrenceId->format('Y-m-d H:i:s')); + $seenExternalIds[] = $externalId; + + $event = $this->upsertEvent($externalId, $remoteEvent, $parsedEvent); + $scheduledReminders += $this->syncReminders($event, $parsedEvent); + $syncedEvents++; + } + } + + $cancelledEvents = $this->cancelMissingEvents($seenExternalIds); + + $run->update([ + 'status' => 'success', + 'finished_at' => Carbon::now(), + 'fetched_contacts' => count($remoteEvents), + 'synced_contacts' => $syncedEvents, + 'deleted_contacts' => $cancelledEvents, + 'message' => $syncedEvents.' evenement(s) CalDAV synchronise(s), '.$scheduledReminders.' rappel(s) programme(s).', + ]); + }); + } catch (Throwable $exception) { + $run->update([ + 'status' => 'failed', + 'finished_at' => Carbon::now(), + 'error' => $exception->getMessage(), + ]); + + throw $exception; + } + + return $run->refresh(); + } + + private function upsertEvent(string $externalId, CalendarRemoteEvent $remoteEvent, ParsedCalendarEvent $parsedEvent): CalendarEvent + { + $event = CalendarEvent::query() + ->where('source', 'caldav') + ->where('external_id', $externalId) + ->first(); + + // Preserve the reminder history when an existing single event becomes a series. + if (! $event && $parsedEvent->recurrenceId !== null) { + $event = CalendarEvent::query() + ->where('source', 'caldav') + ->where('external_id', $parsedEvent->uid) + ->where('starts_at', $parsedEvent->recurrenceId->format('Y-m-d H:i:s')) + ->first(); + } + + $attributes = [ + 'source' => 'caldav', + 'external_id' => $externalId, + 'remote_url' => $remoteEvent->href, + 'remote_etag' => $remoteEvent->etag, + 'summary' => $parsedEvent->summary, + 'description' => $parsedEvent->description, + 'location' => $parsedEvent->location, + 'starts_at' => $parsedEvent->startsAt, + 'ends_at' => $parsedEvent->endsAt, + 'attendees' => $parsedEvent->attendees, + 'synced_at' => Carbon::now(), + 'deleted_at' => null, + ]; + + if (! $event) { + return CalendarEvent::query()->create($attributes); + } + + $event->fill($attributes); + $event->save(); + + return $event; + } + + private function syncReminders(CalendarEvent $event, ParsedCalendarEvent $parsedEvent): int + { + $seenReminderKeys = []; + $scheduledReminders = 0; + + foreach ($parsedEvent->alarms as $index => $alarm) { + if ($alarm->action !== 'DISPLAY') { + continue; + } + + $remindAt = $this->remindAt($parsedEvent, $alarm); + + if ($remindAt === null) { + continue; + } + + $reminderKey = sha1($alarm->action.'|'.$alarm->trigger.'|'.$index); + $seenReminderKeys[] = $reminderKey; + $reminder = CalendarReminder::query() + ->where('calendar_event_id', $event->id) + ->where('reminder_key', $reminderKey) + ->first(); + + $attributes = [ + 'action' => $alarm->action, + 'trigger_minutes' => $alarm->triggerMinutes, + 'remind_at' => $remindAt, + ]; + + if (! $reminder) { + CalendarReminder::query()->create(array_merge($attributes, [ + 'calendar_event_id' => $event->id, + 'reminder_key' => $reminderKey, + 'status' => 'pending', + ])); + $scheduledReminders++; + + continue; + } + + if (! in_array($reminder->status, ['sent', 'sending', 'uncertain', 'skipped'], true)) { + $reminder->update(array_merge($attributes, [ + 'status' => 'pending', + 'last_error' => null, + ])); + $scheduledReminders++; + } + } + + CalendarReminder::query() + ->where('calendar_event_id', $event->id) + ->whereNotIn('reminder_key', $seenReminderKeys ?: ['']) + ->whereIn('status', ['pending', 'failed']) + ->update([ + 'status' => 'cancelled', + 'last_error' => 'Rappel absent de la derniere synchronisation.', + ]); + + return $scheduledReminders; + } + + private function remindAt(ParsedCalendarEvent $event, ParsedCalendarAlarm $alarm): ?Carbon + { + if ($alarm->absoluteRemindAt !== null) { + return $alarm->absoluteRemindAt; + } + + if ($event->startsAt === null || $alarm->triggerMinutes === null) { + return null; + } + + return $event->startsAt->copy()->addMinutes($alarm->triggerMinutes); + } + + /** + * @param array $seenExternalIds + */ + private function cancelMissingEvents(array $seenExternalIds): int + { + $events = CalendarEvent::query() + ->where('source', 'caldav') + ->whereNull('deleted_at') + ->whereNotIn('external_id', $seenExternalIds ?: ['']) + ->get(); + + foreach ($events as $event) { + $event->update(['deleted_at' => Carbon::now()]); + $event->reminders() + ->whereIn('status', ['pending', 'failed']) + ->update([ + 'status' => 'cancelled', + 'last_error' => 'Evenement absent de la derniere synchronisation.', + ]); + } + + return $events->count(); + } +} diff --git a/app/Services/Calendar/CalendarOccurrenceExpander.php b/app/Services/Calendar/CalendarOccurrenceExpander.php new file mode 100644 index 0000000..ce92cd1 --- /dev/null +++ b/app/Services/Calendar/CalendarOccurrenceExpander.php @@ -0,0 +1,82 @@ +select('VEVENT') as $event) { + // A cancelled detached occurrence may contain only UID and RECURRENCE-ID. + // It must still suppress the original occurrence during expansion. + if (! isset($event->DTSTART) && isset($event->{'RECURRENCE-ID'})) { + $start = clone $event->{'RECURRENCE-ID'}; + $start->name = 'DTSTART'; + $event->add($start); + } + + // VObject chooses RDATE instead of RRULE when both are present. + // Expand their union separately, then deduplicate by occurrence identity. + if (isset($event->RRULE, $event->RDATE)) { + $additionalUids[] = (string) $event->UID; + unset($event->RDATE); + } + } + + $timezone = new DateTimeZone((string) config('app.timezone', 'UTC')); + $expanded = $calendar->expand($from, $to, $timezone); + + if ($additionalUids !== []) { + foreach ($additionalDates->select('VEVENT') as $event) { + if (! in_array((string) $event->UID, $additionalUids, true)) { + $additionalDates->remove($event); + } else { + unset($event->RRULE); + if (! isset($event->DTSTART) && isset($event->{'RECURRENCE-ID'})) { + $start = clone $event->{'RECURRENCE-ID'}; + $start->name = 'DTSTART'; + $event->add($start); + } + } + } + + $seen = []; + foreach ($expanded->select('VEVENT') as $event) { + $seen[$this->identity($event)] = true; + } + foreach ($additionalDates->expand($from, $to, $timezone)->select('VEVENT') as $event) { + $key = $this->identity($event); + if (! isset($seen[$key])) { + $expanded->add(clone $event); + $seen[$key] = true; + } + } + } + + return $expanded->serialize(); + } + + private function identity(VEvent $event): string + { + return (string) $event->UID.'|'.(string) $event->{'RECURRENCE-ID'}; + } +} diff --git a/app/Services/Calendar/CalendarReminderSender.php b/app/Services/Calendar/CalendarReminderSender.php new file mode 100644 index 0000000..89a2eca --- /dev/null +++ b/app/Services/Calendar/CalendarReminderSender.php @@ -0,0 +1,269 @@ +copy()->utc()->format('Y-m-d H:i:s'); + $sent = 0; + + CalendarReminder::query() + ->with('event') + ->where('status', 'pending') + ->whereNotNull('remind_at') + ->where('remind_at', '<=', $dueAt) + ->orderBy('remind_at') + ->limit($limit) + ->get() + ->each(function (CalendarReminder $reminder) use (&$sent, $now): void { + if ($this->sendReminder($reminder, $now)) { + $sent++; + } + }); + + return $sent; + } + + private function sendReminder(CalendarReminder $reminder, Carbon $now): bool + { + $reminder = DB::transaction(function () use ($reminder): ?CalendarReminder { + $fresh = CalendarReminder::query() + ->whereKey($reminder->id) + ->lockForUpdate() + ->first(); + + if (! $fresh || $fresh->status !== 'pending') { + return null; + } + + $fresh->update(['status' => 'sending']); + + return $fresh->load('event'); + }); + + if (! $reminder || ! $reminder->event || $reminder->event->deleted_at !== null) { + return false; + } + + $rawStartsAt = $reminder->event->getRawOriginal('starts_at'); + $rawRemindAt = $reminder->getRawOriginal('remind_at'); + + if ($rawStartsAt !== null && $rawRemindAt !== null) { + $startsAt = Carbon::parse((string) $rawStartsAt, 'UTC'); + $remindAt = Carbon::parse((string) $rawRemindAt, 'UTC'); + + if ($remindAt->lessThan($startsAt) && $startsAt->lessThanOrEqualTo($now)) { + $reminder->update([ + 'status' => 'skipped', + 'last_error' => 'Rappel expire : evenement deja commence.', + ]); + + return false; + } + } + + $resolution = $this->recipientResolver->resolve( + $this->contactIdsForReminder($reminder), + $this->configuredIds('relais_sms.caldav.default_group_ids'), + ); + + if ($resolution->recipients === []) { + $reminder->update([ + 'status' => 'skipped', + 'last_error' => 'Aucun destinataire SMS valide pour ce rappel.', + ]); + + return false; + } + + $maxRecipients = (int) config('relais_sms.default_settings.max_sms_per_campaign', 100); + + if (count($resolution->recipients) > $maxRecipients) { + $reminder->update([ + 'status' => 'failed', + 'last_error' => 'La selection depasse la limite de '.$maxRecipients.' SMS.', + ]); + + return false; + } + + $user = $this->user(); + + if ($user === null) { + $reminder->update([ + 'status' => 'failed', + 'last_error' => 'Aucun utilisateur applicatif disponible.', + ]); + + return false; + } + + $campaign = $this->campaignSender->send($user, $this->message($reminder), $resolution->recipients); + + $reminder->update([ + 'sms_campaign_id' => $campaign->id, + 'status' => in_array($campaign->status, ['failed', 'uncertain'], true) ? $campaign->status : 'sent', + 'last_error' => $campaign->error_message, + 'sent_at' => in_array($campaign->status, ['failed', 'uncertain'], true) ? null : Carbon::now(), + ]); + + return in_array($campaign->status, ['sent', 'partial'], true); + } + + /** + * @return array + */ + private function contactIdsForReminder(CalendarReminder $reminder): array + { + $ids = $this->configuredIds('relais_sms.caldav.default_contact_ids'); + $attendeeEmails = collect($reminder->event->attendees ?? []) + ->pluck('email') + ->filter() + ->map(fn (string $email): string => strtolower($email)) + ->unique() + ->values() + ->all(); + + if ($attendeeEmails !== []) { + $ids = array_merge($ids, Contact::query() + ->whereIn(DB::raw('lower(email)'), $attendeeEmails) + ->pluck('id') + ->all()); + } + + return array_values(array_unique(array_map('intval', $ids))); + } + + /** + * @return array + */ + private function configuredIds(string $key): array + { + return collect(config($key, [])) + ->map(fn (mixed $id): int => (int) $id) + ->filter(fn (int $id): bool => $id > 0) + ->unique() + ->values() + ->all(); + } + + private function user(): ?User + { + $userId = (int) config('relais_sms.caldav.reminder_user_id'); + + if ($userId > 0) { + return User::query()->find($userId); + } + + return User::query()->orderBy('id')->first(); + } + + private function message(CalendarReminder $reminder): string + { + $event = $reminder->event; + $rawStartsAt = $event->getRawOriginal('starts_at'); + $startsAt = $rawStartsAt === null + ? 'date inconnue' + : Carbon::parse((string) $rawStartsAt, 'UTC') + ->timezone((string) config('relais_sms.caldav.display_timezone')) + ->format('d/m/Y H:i'); + $titlePrefix = 'Rappel : '; + $title = trim((string) ($event->summary ?: 'Evenement')); + $title = $this->smsMessageLength->truncateBetween( + $titlePrefix, + $title, + "\n".$startsAt, + ); + $coreLines = [$titlePrefix.$title, $startsAt]; + $header = ''; + $footer = ''; + + $configuredHeader = trim($this->configuredText('relais_sms.caldav.reminder_message_header')); + if ($configuredHeader !== '' && $this->smsMessageLength->fitsInOneSms($this->assembleMessage($coreLines, $configuredHeader))) { + $header = $configuredHeader; + } + + $configuredFooter = trim($this->configuredText('relais_sms.caldav.reminder_message_footer')); + if ($configuredFooter !== '' && $this->smsMessageLength->fitsInOneSms($this->assembleMessage($coreLines, $header, $configuredFooter))) { + $footer = $configuredFooter; + } + + $location = trim(preg_replace('/\s+/', ' ', (string) $event->location) ?? ''); + if ($location !== '' && $this->fitsWithOptionalParts($coreLines, [$location], $header, $footer)) { + $coreLines[] = $location; + } + + $description = $this->description((string) $event->description); + if ($description !== '') { + $prefix = collect([$header, ...$coreLines]) + ->filter(fn (string $part): bool => $part !== '') + ->implode("\n")."\n"; + $suffix = $footer === '' ? '' : "\n".$footer; + $description = $this->smsMessageLength->truncateBetween($prefix, $description, $suffix); + + if ($description !== '') { + $coreLines[] = $description; + } + } + + return $this->assembleMessage($coreLines, $header, $footer); + } + + /** + * @param array $coreLines + * @param array $optionalLines + */ + private function fitsWithOptionalParts(array $coreLines, array $optionalLines, string $header, string $footer): bool + { + return $this->smsMessageLength->fitsInOneSms($this->assembleMessage([...$coreLines, ...$optionalLines], $header, $footer)); + } + + /** @param array $coreLines */ + private function assembleMessage(array $coreLines, string $header = '', string $footer = ''): string + { + return collect([ + $header, + ...$coreLines, + $footer, + ])->map(fn (string $part): string => trim($part)) + ->filter() + ->implode("\n"); + } + + private function description(string $description): string + { + $description = trim(preg_replace('/\s+/', ' ', $description) ?? ''); + + if ($description === '') { + return ''; + } + + $maxLength = max(1, (int) config('relais_sms.caldav.reminder_description_max_length', 120)); + + return Str::limit($description, $maxLength, '[...]'); + } + + private function configuredText(string $key): string + { + return str_replace('\n', "\n", (string) config($key, '')); + } +} diff --git a/app/Services/Calendar/CalendarRemoteEvent.php b/app/Services/Calendar/CalendarRemoteEvent.php new file mode 100644 index 0000000..f1c89c5 --- /dev/null +++ b/app/Services/Calendar/CalendarRemoteEvent.php @@ -0,0 +1,12 @@ + + */ + public function parse(string $ical, ?CarbonInterface $from = null, ?CarbonInterface $to = null): array + { + $ical = (new CalendarOccurrenceExpander)->expand( + $ical, + $from ?? Carbon::now()->subDay(), + $to ?? Carbon::now()->addDays((int) config('relais_sms.caldav.lookahead_days', 90)), + ); + $lines = $this->unfoldLines($ical); + $events = []; + $eventLines = null; + $alarmLines = null; + $alarms = []; + + foreach ($lines as $line) { + $upper = strtoupper($line); + + if ($upper === 'BEGIN:VEVENT') { + $eventLines = []; + $alarms = []; + + continue; + } + + if ($upper === 'END:VEVENT') { + if ($eventLines !== null) { + $event = $this->parseEvent($eventLines, $alarms); + if (! $event->cancelled) { + $events[] = $event; + } + } + + $eventLines = null; + $alarmLines = null; + $alarms = []; + + continue; + } + + if ($eventLines === null) { + continue; + } + + if ($upper === 'BEGIN:VALARM') { + $alarmLines = []; + + continue; + } + + if ($upper === 'END:VALARM') { + if ($alarmLines !== null) { + $alarms[] = $this->parseAlarm($alarmLines); + } + + $alarmLines = null; + + continue; + } + + if ($alarmLines !== null) { + $alarmLines[] = $line; + + continue; + } + + $eventLines[] = $line; + } + + return array_values(array_filter($events, fn (ParsedCalendarEvent $event): bool => $event->uid !== '')); + } + + /** + * @param array $lines + * @param array $alarms + */ + private function parseEvent(array $lines, array $alarms): ParsedCalendarEvent + { + $uid = ''; + $summary = null; + $description = null; + $location = null; + $startsAt = null; + $endsAt = null; + $attendees = []; + $recurrenceId = null; + $cancelled = false; + + foreach ($lines as $line) { + $property = $this->parseProperty($line); + $name = strtoupper($property['name']); + + match ($name) { + 'UID' => $uid = $this->decodeText($property['value']), + 'SUMMARY' => $summary = $this->decodeText($property['value']), + 'DESCRIPTION' => $description = $this->decodeText($property['value']), + 'LOCATION' => $location = $this->decodeText($property['value']), + 'DTSTART' => $startsAt = $this->parseDateTime($property['value'], $property['params']), + 'DTEND' => $endsAt = $this->parseDateTime($property['value'], $property['params']), + 'RECURRENCE-ID' => $recurrenceId = $this->parseDateTime($property['value'], $property['params']), + 'STATUS' => $cancelled = strtoupper($property['value']) === 'CANCELLED', + 'ATTENDEE', 'ORGANIZER' => $attendees[] = $this->parseAttendee($property['value'], $property['params']), + default => null, + }; + } + + return new ParsedCalendarEvent( + uid: $uid, + summary: $summary, + description: $description, + location: $location, + startsAt: $startsAt, + endsAt: $endsAt, + attendees: array_values(array_filter( + $attendees, + fn (array $attendee): bool => $attendee['email'] !== '', + )), + alarms: $alarms, + recurrenceId: $recurrenceId, + cancelled: $cancelled, + ); + } + + /** + * @param array $lines + */ + private function parseAlarm(array $lines): ParsedCalendarAlarm + { + $action = ''; + $trigger = ''; + $triggerMinutes = null; + $absoluteRemindAt = null; + + foreach ($lines as $line) { + $property = $this->parseProperty($line); + $name = strtoupper($property['name']); + + if ($name === 'ACTION') { + $action = strtoupper($property['value']); + } + + if ($name === 'TRIGGER') { + $trigger = $property['value']; + + if (strtoupper((string) ($property['params']['VALUE'] ?? '')) === 'DATE-TIME') { + $absoluteRemindAt = $this->parseDateTime($property['value'], $property['params']); + } else { + $triggerMinutes = $this->parseDurationMinutes($property['value']); + } + } + } + + return new ParsedCalendarAlarm( + action: $action, + trigger: $trigger, + triggerMinutes: $triggerMinutes, + absoluteRemindAt: $absoluteRemindAt, + ); + } + + /** + * @return array{name: string, params: array, value: string} + */ + private function parseProperty(string $line): array + { + [$left, $value] = $this->splitPropertyValue($line); + $parts = $this->splitOutsideQuotes($left, ';'); + $name = array_shift($parts) ?: ''; + $params = []; + + foreach ($parts as $part) { + [$key, $paramValue] = array_pad(explode('=', $part, 2), 2, ''); + + if ($key !== '') { + $params[strtoupper($key)] = trim($paramValue, '"'); + } + } + + return [ + 'name' => $name, + 'params' => $params, + 'value' => $value, + ]; + } + + /** + * A CalDAV parameter can contain a URI, for example + * MEMBER="mailto:circle+id@example.test". The colon in that quoted URI is + * not the separator between the property metadata and its value. + * + * @return array{string, string} + */ + private function splitPropertyValue(string $line): array + { + $quoted = false; + + for ($index = 0, $length = strlen($line); $index < $length; $index++) { + if ($line[$index] === '"') { + $quoted = ! $quoted; + + continue; + } + + if ($line[$index] === ':' && ! $quoted) { + return [substr($line, 0, $index), substr($line, $index + 1)]; + } + } + + return [$line, '']; + } + + /** + * @return array + */ + private function splitOutsideQuotes(string $value, string $delimiter): array + { + $parts = []; + $part = ''; + $quoted = false; + + for ($index = 0, $length = strlen($value); $index < $length; $index++) { + $character = $value[$index]; + + if ($character === '"') { + $quoted = ! $quoted; + } + + if ($character === $delimiter && ! $quoted) { + $parts[] = $part; + $part = ''; + + continue; + } + + $part .= $character; + } + + $parts[] = $part; + + return $parts; + } + + /** + * @param array $params + * @return array{email: string, name: ?string} + */ + private function parseAttendee(string $value, array $params): array + { + $email = preg_replace('/^mailto:/i', '', trim($value)) ?? ''; + + return [ + 'email' => strtolower($email), + 'name' => isset($params['CN']) ? $this->decodeText($params['CN']) : null, + ]; + } + + /** + * @param array $params + */ + private function parseDateTime(string $value, array $params): ?Carbon + { + $value = trim($value); + + if ($value === '') { + return null; + } + + $timezone = $params['TZID'] ?? config('app.timezone', 'UTC'); + + if (str_ends_with($value, 'Z')) { + return Carbon::createFromFormat('Ymd\THis\Z', $value, 'UTC')?->utc(); + } + + if (str_contains($value, 'T')) { + return Carbon::createFromFormat('Ymd\THis', $value, $timezone)?->utc(); + } + + return Carbon::createFromFormat('Ymd', $value, $timezone)?->startOfDay()->utc(); + } + + private function parseDurationMinutes(string $value): ?int + { + $value = strtoupper(trim($value)); + + if (! preg_match('/^([+-])?P(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/', $value, $matches)) { + return null; + } + + $sign = ($matches[1] ?? '') === '-' ? -1 : 1; + $days = (int) ($matches[2] ?? 0); + $hours = (int) ($matches[3] ?? 0); + $minutes = (int) ($matches[4] ?? 0); + $seconds = (int) ($matches[5] ?? 0); + + return $sign * (($days * 24 * 60) + ($hours * 60) + $minutes + (int) ceil($seconds / 60)); + } + + /** + * @return array + */ + private function unfoldLines(string $ical): array + { + $rawLines = preg_split('/\r\n|\n|\r/', $ical) ?: []; + $lines = []; + + foreach ($rawLines as $line) { + if ($line === '') { + continue; + } + + if ((str_starts_with($line, ' ') || str_starts_with($line, "\t")) && $lines !== []) { + $lines[array_key_last($lines)] .= substr($line, 1); + + continue; + } + + $lines[] = $line; + } + + return $lines; + } + + private function decodeText(string $value): string + { + return str_replace( + ['\\n', '\\N', '\\,', '\\;', '\\\\'], + ["\n", "\n", ',', ';', '\\'], + $value, + ); + } +} diff --git a/app/Services/Calendar/ParsedCalendarAlarm.php b/app/Services/Calendar/ParsedCalendarAlarm.php new file mode 100644 index 0000000..19258c1 --- /dev/null +++ b/app/Services/Calendar/ParsedCalendarAlarm.php @@ -0,0 +1,15 @@ + $attendees + * @param array $alarms + */ + public function __construct( + public readonly string $uid, + public readonly ?string $summary, + public readonly ?string $description, + public readonly ?string $location, + public readonly ?Carbon $startsAt, + public readonly ?Carbon $endsAt, + public readonly array $attendees, + public readonly array $alarms, + public readonly ?Carbon $recurrenceId = null, + public readonly bool $cancelled = false, + ) {} +} diff --git a/app/Services/CardDav/CardDavClient.php b/app/Services/CardDav/CardDavClient.php new file mode 100644 index 0000000..56ea452 --- /dev/null +++ b/app/Services/CardDav/CardDavClient.php @@ -0,0 +1,213 @@ +fetchCardsWithReport(); + + if ($cards !== []) { + return $cards; + } + } catch (GuzzleException|RuntimeException) { + // Some CardDAV servers restrict addressbook-query. Fall back to PROPFIND + GET. + } + + return $this->fetchCardsWithPropfind(); + } + + /** + * @return array + */ + private function fetchCardsWithReport(): array + { + $url = rtrim((string) config('relais_sms.carddav.url'), '/').'/'; + $username = (string) config('relais_sms.carddav.username'); + $password = (string) config('relais_sms.carddav.password'); + + $this->ensureConfigured($url, $username, $password); + + $response = $this->http->request('REPORT', $url, [ + 'auth' => [$username, $password], + 'headers' => [ + 'Content-Type' => 'application/xml; charset=utf-8', + 'Depth' => '1', + ], + 'body' => <<<'XML' + + + + + + + +XML, + 'timeout' => (float) config('relais_sms.carddav.timeout'), + ]); + + return $this->parseReport((string) $response->getBody()); + } + + /** + * @return array + */ + private function fetchCardsWithPropfind(): array + { + $url = rtrim((string) config('relais_sms.carddav.url'), '/').'/'; + $username = (string) config('relais_sms.carddav.username'); + $password = (string) config('relais_sms.carddav.password'); + + $this->ensureConfigured($url, $username, $password); + + $response = $this->http->request('PROPFIND', $url, [ + 'auth' => [$username, $password], + 'headers' => [ + 'Content-Type' => 'application/xml; charset=utf-8', + 'Depth' => '1', + ], + 'body' => <<<'XML' + + + + + + +XML, + 'timeout' => (float) config('relais_sms.carddav.timeout'), + ]); + + $entries = $this->parsePropfind((string) $response->getBody(), $url); + $cards = []; + + foreach ($entries as $entry) { + $cardResponse = $this->http->request('GET', $entry['url'], [ + 'auth' => [$username, $password], + 'headers' => [ + 'Accept' => 'text/vcard,text/x-vcard,text/plain,*/*', + ], + 'timeout' => (float) config('relais_sms.carddav.timeout'), + ]); + + $cards[] = new CardDavRemoteCard( + href: $entry['href'], + etag: $entry['etag'], + vcard: (string) $cardResponse->getBody(), + ); + } + + return $cards; + } + + private function ensureConfigured(string $url, string $username, string $password): void + { + if ($url === '/' || $username === '' || $password === '') { + throw new RuntimeException('Configuration CardDAV incomplete.'); + } + } + + /** + * @return array + */ + private function parseReport(string $xml): array + { + try { + $document = new SimpleXMLElement($xml); + } catch (Throwable $exception) { + throw new RuntimeException('Reponse CardDAV REPORT illisible.', previous: $exception); + } + + $document->registerXPathNamespace('d', 'DAV:'); + $responses = $document->xpath('//d:response') ?: []; + $cards = []; + + foreach ($responses as $response) { + $response->registerXPathNamespace('d', 'DAV:'); + $response->registerXPathNamespace('c', 'urn:ietf:params:xml:ns:carddav'); + + $hrefNodes = $response->xpath('./d:href') ?: []; + $cardNodes = $response->xpath('.//c:address-data') ?: []; + $href = trim((string) ($hrefNodes[0] ?? '')); + $vcard = (string) ($cardNodes[0] ?? ''); + + if ($href === '' || trim($vcard) === '') { + continue; + } + + $etagNodes = $response->xpath('.//d:getetag') ?: []; + $cards[] = new CardDavRemoteCard( + href: $href, + etag: trim((string) ($etagNodes[0] ?? ''), '"') ?: null, + vcard: $vcard, + ); + } + + return $cards; + } + + /** + * @return array + */ + private function parsePropfind(string $xml, string $baseUrl): array + { + try { + $document = new SimpleXMLElement($xml); + } catch (Throwable $exception) { + throw new RuntimeException('Reponse CardDAV PROPFIND illisible.', previous: $exception); + } + + $document->registerXPathNamespace('d', 'DAV:'); + $responses = $document->xpath('//d:response') ?: []; + $entries = []; + + foreach ($responses as $response) { + $response->registerXPathNamespace('d', 'DAV:'); + $hrefNodes = $response->xpath('./d:href') ?: []; + $href = trim((string) ($hrefNodes[0] ?? '')); + + if ($href === '' || ! str_ends_with(strtolower(parse_url($href, PHP_URL_PATH) ?: $href), '.vcf')) { + continue; + } + + $etagNodes = $response->xpath('.//d:getetag') ?: []; + $entries[] = [ + 'href' => $href, + 'etag' => trim((string) ($etagNodes[0] ?? ''), '"') ?: null, + 'url' => $this->absoluteUrl($baseUrl, $href), + ]; + } + + return $entries; + } + + private function absoluteUrl(string $baseUrl, string $href): string + { + if (parse_url($href, PHP_URL_SCHEME)) { + return $href; + } + + $base = parse_url($baseUrl); + + if (! isset($base['scheme'], $base['host'])) { + throw new RuntimeException('URL CardDAV invalide.'); + } + + $port = isset($base['port']) ? ':'.$base['port'] : ''; + $path = str_starts_with($href, '/') ? $href : rtrim((string) ($base['path'] ?? ''), '/').'/'.$href; + + return $base['scheme'].'://'.$base['host'].$port.$path; + } +} diff --git a/app/Services/CardDav/CardDavContactSyncService.php b/app/Services/CardDav/CardDavContactSyncService.php new file mode 100644 index 0000000..7b2100d --- /dev/null +++ b/app/Services/CardDav/CardDavContactSyncService.php @@ -0,0 +1,240 @@ +create([ + 'source' => 'carddav', + 'status' => 'running', + 'started_at' => Carbon::now(), + ]); + + try { + $cards = $this->client->fetchCards(); + + DB::transaction(function () use ($run, $cards): void { + $seenContactExternalIds = []; + $seenGroupExternalIds = []; + $syncedContacts = 0; + + foreach ($cards as $card) { + $parsedCard = $this->parser->parse($card->vcard); + $externalId = $this->externalId($parsedCard, $card); + $seenContactExternalIds[] = $externalId; + + $contact = $this->upsertContact($externalId, $card, $parsedCard); + $this->replacePhoneNumbers($contact, $parsedCard); + + $groupIds = []; + + foreach ($parsedCard->categories as $category) { + $group = $this->upsertGroup($category); + $groupIds[] = $group->id; + $seenGroupExternalIds[] = (string) $group->external_id; + } + + $this->syncCardDavGroupMemberships($contact, $groupIds); + $syncedContacts++; + } + + $deletedContacts = $this->deleteMissingContacts($seenContactExternalIds); + $this->deleteMissingGroups(array_values(array_unique($seenGroupExternalIds))); + + $run->update([ + 'status' => 'success', + 'finished_at' => Carbon::now(), + 'fetched_contacts' => count($cards), + 'synced_contacts' => $syncedContacts, + 'deleted_contacts' => $deletedContacts, + 'message' => $syncedContacts.' contact(s) CardDAV synchronise(s).', + ]); + }); + } catch (Throwable $exception) { + $run->update([ + 'status' => 'failed', + 'finished_at' => Carbon::now(), + 'error' => $exception->getMessage(), + ]); + + throw $exception; + } + + return $run->refresh(); + } + + private function upsertContact(string $externalId, CardDavRemoteCard $card, ParsedVCard $parsedCard): Contact + { + $contact = Contact::withTrashed() + ->where('source', 'carddav') + ->where('external_id', $externalId) + ->first(); + + $attributes = [ + 'source' => 'carddav', + 'external_id' => $externalId, + 'remote_url' => $card->href, + 'remote_etag' => $card->etag, + 'first_name' => $parsedCard->firstName, + 'last_name' => $this->lastName($parsedCard), + 'organization' => $parsedCard->organization, + 'email' => $parsedCard->email, + 'synced_at' => Carbon::now(), + ]; + + if (! $contact) { + return Contact::query()->create($attributes); + } + + $contact->fill($attributes); + $contact->deleted_at = null; + $contact->save(); + + return $contact; + } + + private function replacePhoneNumbers(Contact $contact, ParsedVCard $parsedCard): void + { + $contact->phoneNumbers()->delete(); + $defaultCountry = (string) config('relais_sms.default_settings.default_country'); + + foreach ($parsedCard->phoneNumbers as $index => $phoneNumber) { + $result = $this->phoneNumberNormalizer->normalize($phoneNumber->rawNumber, $defaultCountry); + + $contact->phoneNumbers()->create([ + 'label' => $phoneNumber->label, + 'raw_number' => $result->rawNumber, + 'normalized_number' => $result->normalizedNumber, + 'country' => $result->country, + 'is_valid' => $result->isValid, + 'is_mobile' => $result->isMobile, + 'is_primary' => $index === 0, + 'validation_error' => $result->error, + ]); + } + } + + private function upsertGroup(string $category): ContactGroup + { + $externalId = Str::slug($category); + $slug = 'carddav-'.$externalId; + $group = ContactGroup::withTrashed() + ->where('source', 'carddav') + ->where('external_id', $externalId) + ->first(); + + $attributes = [ + 'source' => 'carddav', + 'external_id' => $externalId, + 'name' => $category, + 'slug' => $slug, + 'synced_at' => Carbon::now(), + ]; + + if (! $group) { + return ContactGroup::query()->create($attributes); + } + + $group->fill($attributes); + $group->deleted_at = null; + $group->save(); + + return $group; + } + + /** + * @param array $groupIds + */ + private function syncCardDavGroupMemberships(Contact $contact, array $groupIds): void + { + $currentCardDavGroupIds = $contact->groups() + ->where('contact_groups.source', 'carddav') + ->pluck('contact_groups.id') + ->all(); + + if ($currentCardDavGroupIds !== []) { + $contact->groups()->detach($currentCardDavGroupIds); + } + + if ($groupIds !== []) { + $contact->groups()->syncWithoutDetaching($groupIds); + } + } + + /** + * @param array $seenExternalIds + */ + private function deleteMissingContacts(array $seenExternalIds): int + { + $contacts = Contact::query() + ->where('source', 'carddav') + ->whereNotIn('external_id', $seenExternalIds ?: ['']) + ->get(); + + foreach ($contacts as $contact) { + $cardDavGroupIds = $contact->groups() + ->where('contact_groups.source', 'carddav') + ->pluck('contact_groups.id') + ->all(); + + if ($cardDavGroupIds !== []) { + $contact->groups()->detach($cardDavGroupIds); + } + + $contact->delete(); + } + + return $contacts->count(); + } + + /** + * @param array $seenExternalIds + */ + private function deleteMissingGroups(array $seenExternalIds): void + { + ContactGroup::query() + ->where('source', 'carddav') + ->whereNotIn('external_id', $seenExternalIds ?: ['']) + ->delete(); + } + + private function externalId(ParsedVCard $parsedCard, CardDavRemoteCard $card): string + { + return $parsedCard->uid ?: sha1($card->href); + } + + private function lastName(ParsedVCard $parsedCard): string + { + if ($parsedCard->lastName) { + return $parsedCard->lastName; + } + + if ($parsedCard->fullName) { + return $parsedCard->fullName; + } + + if ($parsedCard->organization) { + return $parsedCard->organization; + } + + return 'Contact CardDAV'; + } +} diff --git a/app/Services/CardDav/CardDavRemoteCard.php b/app/Services/CardDav/CardDavRemoteCard.php new file mode 100644 index 0000000..8a5ff79 --- /dev/null +++ b/app/Services/CardDav/CardDavRemoteCard.php @@ -0,0 +1,12 @@ + $phoneNumbers + * @param array $categories + */ + public function __construct( + public ?string $uid, + public ?string $fullName, + public ?string $firstName, + public ?string $lastName, + public ?string $organization, + public ?string $email, + public array $phoneNumbers, + public array $categories, + ) {} +} diff --git a/app/Services/CardDav/ParsedVCardPhoneNumber.php b/app/Services/CardDav/ParsedVCardPhoneNumber.php new file mode 100644 index 0000000..4fd6efc --- /dev/null +++ b/app/Services/CardDav/ParsedVCardPhoneNumber.php @@ -0,0 +1,11 @@ +parseLines($contents) as $line) { + [$name, $params, $value] = $line; + + match ($name) { + 'UID' => $uid = $uid ?? $this->cleanValue($value), + 'FN' => $fullName = $fullName ?? $this->cleanValue($value), + 'N' => [$lastName, $firstName] = $this->parseStructuredName($value, $lastName, $firstName), + 'ORG' => $organization = $organization ?? $this->cleanValue($this->splitEscaped($value, ';')[0] ?? ''), + 'EMAIL' => $email = $email ?? $this->cleanValue($value), + 'TEL' => $phoneNumbers[] = new ParsedVCardPhoneNumber($this->cleanValue($value), $this->phoneLabel($params)), + 'CATEGORIES' => $categories = array_merge($categories, $this->parseCategories($value)), + default => null, + }; + } + + $categories = array_values(array_unique(array_filter($categories))); + + return new ParsedVCard( + uid: $uid, + fullName: $fullName, + firstName: $firstName, + lastName: $lastName, + organization: $organization, + email: $email, + phoneNumbers: array_values(array_filter( + $phoneNumbers, + fn (ParsedVCardPhoneNumber $phoneNumber): bool => $phoneNumber->rawNumber !== '', + )), + categories: $categories, + ); + } + + /** + * @return array>, 2: string}> + */ + private function parseLines(string $contents): array + { + $contents = str_replace(["\r\n", "\r"], "\n", $contents); + $contents = preg_replace("/\n[ \t]/", '', $contents) ?? $contents; + $lines = []; + + foreach (explode("\n", $contents) as $line) { + $line = trim($line); + + if ($line === '' || ! str_contains($line, ':')) { + continue; + } + + [$left, $value] = explode(':', $line, 2); + $propertyParts = explode(';', $left); + $name = strtoupper((string) array_shift($propertyParts)); + + if ($name === 'BEGIN' || $name === 'END' || $name === 'VERSION') { + continue; + } + + $params = []; + + foreach ($propertyParts as $part) { + if (str_contains($part, '=')) { + [$paramName, $paramValue] = explode('=', $part, 2); + $paramName = strtoupper($paramName); + $params[$paramName] = array_merge( + $params[$paramName] ?? [], + array_map('strtoupper', $this->splitEscaped($paramValue, ',')), + ); + + continue; + } + + $params['TYPE'][] = strtoupper($part); + } + + $lines[] = [$name, $params, $value]; + } + + return $lines; + } + + /** + * @return array{0: ?string, 1: ?string} + */ + private function parseStructuredName(string $value, ?string $currentLastName, ?string $currentFirstName): array + { + $parts = $this->splitEscaped($value, ';'); + $lastName = $this->cleanValue($parts[0] ?? '') ?: $currentLastName; + $firstName = $this->cleanValue($parts[1] ?? '') ?: $currentFirstName; + + return [$lastName, $firstName]; + } + + /** + * @return array + */ + private function parseCategories(string $value): array + { + return array_map( + fn (string $category): string => $this->cleanValue($category), + $this->splitEscaped($value, ','), + ); + } + + /** + * @param array> $params + */ + private function phoneLabel(array $params): ?string + { + $types = array_filter($params['TYPE'] ?? []); + + if ($types === []) { + return null; + } + + return implode(', ', array_map( + fn (string $type): string => ucfirst(strtolower($type)), + array_unique($types), + )); + } + + /** + * @return array + */ + private function splitEscaped(string $value, string $separator): array + { + $parts = []; + $buffer = ''; + $escaped = false; + + foreach (str_split($value) as $char) { + if ($escaped) { + $buffer .= '\\'.$char; + $escaped = false; + + continue; + } + + if ($char === '\\') { + $escaped = true; + + continue; + } + + if ($char === $separator) { + $parts[] = $buffer; + $buffer = ''; + + continue; + } + + $buffer .= $char; + } + + if ($escaped) { + $buffer .= '\\'; + } + + $parts[] = $buffer; + + return $parts; + } + + private function cleanValue(string $value): string + { + $value = str_replace( + ['\n', '\N', '\;', '\,', '\\\\'], + ["\n", "\n", ';', ',', '\\'], + trim($value), + ); + + return trim($value); + } +} diff --git a/app/Services/Phone/LibPhoneNumberNormalizer.php b/app/Services/Phone/LibPhoneNumberNormalizer.php new file mode 100644 index 0000000..55e5e7f --- /dev/null +++ b/app/Services/Phone/LibPhoneNumberNormalizer.php @@ -0,0 +1,56 @@ +phoneNumberUtil->parse($rawNumber, $defaultCountry); + } catch (NumberParseException $exception) { + return new PhoneNumberResult($rawNumber, null, null, false, false, $exception->getMessage()); + } + + $isValid = $this->phoneNumberUtil->isValidNumber($number); + $normalizedNumber = $isValid + ? $this->phoneNumberUtil->format($number, PhoneNumberFormat::E164) + : null; + $country = $this->phoneNumberUtil->getRegionCodeForNumber($number); + $mobileRegex = (string) config('relais_sms.default_settings.mobile_phone_regex'); + $numberType = $this->phoneNumberUtil->getNumberType($number); + $isMobile = $isValid && ( + in_array($numberType, [PhoneNumberType::MOBILE, PhoneNumberType::FIXED_LINE_OR_MOBILE], true) + || ($mobileRegex !== '' && ( + preg_match($mobileRegex, $rawNumber) === 1 + || ($normalizedNumber !== null && preg_match($mobileRegex, $normalizedNumber) === 1) + )) + ); + + return new PhoneNumberResult( + rawNumber: $rawNumber, + normalizedNumber: $normalizedNumber, + country: $country, + isValid: $isValid, + isMobile: $isMobile, + error: $isValid ? null : 'Numero invalide.', + ); + } +} diff --git a/app/Services/Phone/PhoneNumberResult.php b/app/Services/Phone/PhoneNumberResult.php new file mode 100644 index 0000000..707a742 --- /dev/null +++ b/app/Services/Phone/PhoneNumberResult.php @@ -0,0 +1,15 @@ +> $recipients + * @param array> $excluded + */ + public function __construct( + public array $recipients, + public array $excluded, + public int $selectedContactCount, + public int $selectedGroupCount, + ) {} + + /** + * @return array + */ + public function summary(): array + { + return [ + 'selected_contacts' => $this->selectedContactCount, + 'selected_groups' => $this->selectedGroupCount, + 'ready_numbers' => count($this->recipients), + 'excluded_total' => count($this->excluded), + 'opt_out' => $this->countExcludedReason('opt_out'), + 'missing_phone' => $this->countExcludedReason('missing_phone'), + 'invalid' => $this->countExcludedReason('invalid'), + 'non_mobile' => $this->countExcludedReason('non_mobile'), + 'duplicate' => $this->countExcludedReason('duplicate'), + ]; + } + + /** + * @return array> + */ + public function excludedByReason(string $reason): array + { + return array_values(array_filter( + $this->excluded, + fn (array $entry): bool => ($entry['reason'] ?? null) === $reason, + )); + } + + private function countExcludedReason(string $reason): int + { + return count($this->excludedByReason($reason)); + } +} diff --git a/app/Services/Recipients/RecipientResolver.php b/app/Services/Recipients/RecipientResolver.php new file mode 100644 index 0000000..65719ff --- /dev/null +++ b/app/Services/Recipients/RecipientResolver.php @@ -0,0 +1,173 @@ + $contactIds + * @param array $groupIds + */ + public function resolve(array $contactIds, array $groupIds): RecipientResolutionResult + { + $directContactIds = $this->cleanIds($contactIds); + $selectedGroupIds = $this->cleanIds($groupIds); + + $groups = ContactGroup::query() + ->with(['contacts' => fn ($query) => $query->select('contacts.id')]) + ->whereKey($selectedGroupIds) + ->orderBy('name') + ->get(); + + /** @var array> $groupNamesByContactId */ + $groupNamesByContactId = []; + + foreach ($groups as $group) { + foreach ($group->contacts as $contact) { + $groupNamesByContactId[$contact->id][] = $group->name; + } + } + + $selectedContactIds = $directContactIds + ->merge($groups->flatMap(fn (ContactGroup $group): Collection => $group->contacts->pluck('id'))) + ->unique() + ->values(); + + $contacts = Contact::query() + ->with([ + 'groups', + 'phoneNumbers' => fn ($query) => $query + ->orderByDesc('is_primary') + ->orderBy('id'), + ]) + ->whereKey($selectedContactIds) + ->orderBy('last_name') + ->orderBy('first_name') + ->get(); + + $recipients = []; + $excluded = []; + $seenNumbers = []; + + foreach ($contacts as $contact) { + $selection = $this->selectionLabels($contact, $directContactIds, $groupNamesByContactId[$contact->id] ?? []); + + if ($contact->sms_opt_out) { + $excluded[] = $this->excludedEntry($contact, 'opt_out', null, $selection); + + continue; + } + + if ($contact->phoneNumbers->isEmpty()) { + $excluded[] = $this->excludedEntry($contact, 'missing_phone', null, $selection); + + continue; + } + + foreach ($contact->phoneNumbers as $phoneNumber) { + if (! $phoneNumber->is_valid || $phoneNumber->normalized_number === null) { + $excluded[] = $this->excludedEntry($contact, 'invalid', $phoneNumber, $selection); + + continue; + } + + if (! $phoneNumber->hasDetectedMobileNumber()) { + $excluded[] = $this->excludedEntry($contact, 'non_mobile', $phoneNumber, $selection); + + continue; + } + + if (isset($seenNumbers[$phoneNumber->normalized_number])) { + $excluded[] = $this->excludedEntry( + $contact, + 'duplicate', + $phoneNumber, + $selection, + ['duplicate_of' => $seenNumbers[$phoneNumber->normalized_number]], + ); + + continue; + } + + $entry = [ + 'contact_id' => $contact->id, + 'contact_name' => $contact->displayName(), + 'phone_number_id' => $phoneNumber->id, + 'number' => $phoneNumber->normalized_number, + 'raw_number' => $phoneNumber->raw_number, + 'label' => $phoneNumber->label, + 'selection' => $selection, + ]; + + $recipients[] = $entry; + $seenNumbers[$phoneNumber->normalized_number] = $entry['contact_name']; + } + } + + return new RecipientResolutionResult( + recipients: $recipients, + excluded: $excluded, + selectedContactCount: $contacts->count(), + selectedGroupCount: $groups->count(), + ); + } + + /** + * @param array $ids + * @return Collection + */ + private function cleanIds(array $ids): Collection + { + return collect($ids) + ->map(fn (int|string $id): int => (int) $id) + ->filter(fn (int $id): bool => $id > 0) + ->unique() + ->values(); + } + + /** + * @param Collection $directContactIds + * @param array $groupNames + * @return array + */ + private function selectionLabels(Contact $contact, Collection $directContactIds, array $groupNames): array + { + $selection = $groupNames; + + if ($directContactIds->contains($contact->id)) { + array_unshift($selection, 'Selection directe'); + } + + return array_values(array_unique($selection)); + } + + /** + * @param array $selection + * @param array $extra + * @return array + */ + private function excludedEntry( + Contact $contact, + string $reason, + ?ContactPhoneNumber $phoneNumber, + array $selection, + array $extra = [], + ): array { + return array_merge([ + 'contact_id' => $contact->id, + 'contact_name' => $contact->displayName(), + 'contact_source' => $contact->source, + 'phone_number_id' => $phoneNumber?->id, + 'reason' => $reason, + 'number' => $phoneNumber?->normalized_number, + 'raw_number' => $phoneNumber?->raw_number, + 'label' => $phoneNumber?->label, + 'selection' => $selection, + ], $extra); + } +} diff --git a/app/Services/Sms/OvhShortCodeMessage.php b/app/Services/Sms/OvhShortCodeMessage.php new file mode 100644 index 0000000..c3b6a96 --- /dev/null +++ b/app/Services/Sms/OvhShortCodeMessage.php @@ -0,0 +1,21 @@ +]*>(.*?)~isu', '$1', $message) ?? $message; + $message = preg_replace('~https?://[^\s<>"\']+|(?"\']+~iu', '', $message) ?? $message; + // Also remove bare domain links, without eating email addresses or dates. + $message = preg_replace('~(?"\']*)?(?![\pL\pN_@-])~iu', '', $message) ?? $message; + $message = preg_replace('/[ \t]+/u', ' ', $message) ?? $message; + $message = preg_replace('/ *\R */u', "\n", $message) ?? $message; + $message = preg_replace('/\n{3,}/', "\n\n", $message) ?? $message; + + return trim($message); + } +} diff --git a/app/Services/Sms/OvhSmsProvider.php b/app/Services/Sms/OvhSmsProvider.php new file mode 100644 index 0000000..dda7492 --- /dev/null +++ b/app/Services/Sms/OvhSmsProvider.php @@ -0,0 +1,256 @@ +> $recipients + */ + public function send(SmsCampaign $campaign, array $recipients): SmsSendResult + { + $payload = $this->payload($campaign, $recipients); + $serviceName = $this->serviceName(); + $path = '/sms/'.rawurlencode($serviceName).'/jobs'; + // Keep the exact request even if the process loses OVH's response. + if ($campaign->exists) { + $campaign->update([ + 'provider_service_name' => $serviceName, + 'request_payload' => $payload, + 'message' => $payload['message'], + ]); + } + $response = $this->request('POST', $path, $payload); + + if (! isset($response['ids']) || ! is_array($response['ids']) + || count($response['ids']) + count($this->stringList($response['invalidReceivers'] ?? [])) < count($recipients)) { + throw new SmsProviderException('Reponse OVH incomplete : envoi a verifier.', $response, outcomeUnknown: true); + } + + return new SmsSendResult( + serviceName: $serviceName, + providerJobId: $this->stringValue($response['id'] ?? $response['jobId'] ?? null), + requestPayload: $payload, + responsePayload: $response, + providerMessageIds: $this->stringList($response['ids'] ?? []), + failedNumbers: $this->stringList($response['invalidReceivers'] ?? []), + ); + } + + /** @return array> */ + public function outgoing(SmsCampaign $campaign): array + { + if (! $campaign->provider_tag) { + throw new SmsProviderException('Verification impossible sans reference de campagne OVH.'); + } + + $path = '/sms/'.rawurlencode($campaign->provider_service_name ?: $this->serviceName()).'/outgoing'; + $ids = $this->request('GET', $path.'?'.http_build_query(['tag' => $campaign->provider_tag])); + $messages = []; + + foreach ($ids as $id) { + $messages[] = $this->request('GET', $path.'/'.rawurlencode((string) $id)); + } + + return $messages; + } + + private function serviceName(): string + { + $configured = trim((string) config('relais_sms.ovh.sms_service_name', '')); + + if ($configured !== '') { + return $configured; + } + + $services = $this->request('GET', '/sms'); + $service = $services[0] ?? null; + + if (! is_string($service) || $service === '') { + throw new SmsProviderException('Aucun service SMS OVH disponible pour ces identifiants.', [ + 'services' => $services, + ]); + } + + return $service; + } + + /** + * @param array> $recipients + * @return array + */ + private function payload(SmsCampaign $campaign, array $recipients): array + { + $shortCode = (bool) config('relais_sms.ovh.sms_short_code'); + $sender = trim((string) config('relais_sms.ovh.sms_sender', '')); + + if ($shortCode && $sender !== '') { + throw new SmsProviderException('OVH_SMS_SHORT_CODE=true est incompatible avec OVH_SMS_SENDER.'); + } + + if (! $shortCode && $sender === '') { + throw new SmsProviderException('Configurer OVH_SMS_SENDER pour utiliser OVH_SMS_SHORT_CODE=false.'); + } + + $message = $shortCode ? (new OvhShortCodeMessage)->prepare($campaign->message) : $campaign->message; + + if (trim($message) === '') { + throw new SmsProviderException('Le SMS est vide apres retrait des liens interdits par OVH en numero court.'); + } + + $payload = [ + 'message' => $message, + 'receivers' => array_values(array_map( + fn (array $recipient): string => (string) $recipient['number'], + $recipients, + )), + 'noStopClause' => (bool) config('relais_sms.ovh.sms_no_stop_clause'), + 'tag' => $campaign->provider_tag, + ]; + + if ($sender !== '') { + $payload['sender'] = $sender; + } elseif ($shortCode) { + $payload['senderForResponse'] = true; + } + + return $payload; + } + + /** + * @param array|null $payload + * @return array|array + */ + private function request(string $method, string $path, ?array $payload = null): array + { + $body = $payload === null ? '' : json_encode($payload, JSON_THROW_ON_ERROR); + $url = $this->baseUrl().$path; + $timestamp = $this->timestamp(); + + try { + $response = $this->client->request($method, $url, [ + 'headers' => [ + 'Content-Type' => 'application/json', + 'X-Ovh-Application' => $this->requiredConfig('application_key'), + 'X-Ovh-Consumer' => $this->requiredConfig('consumer_key'), + 'X-Ovh-Signature' => $this->signature($method, $url, $body, $timestamp), + 'X-Ovh-Timestamp' => (string) $timestamp, + ], + 'body' => $body, + 'timeout' => $method === 'POST' + ? (float) config('relais_sms.ovh.send_timeout', 60) + : (float) config('relais_sms.ovh.timeout', 20), + 'connect_timeout' => 10, + 'allow_redirects' => false, + ]); + } catch (RequestException $exception) { + $responsePayload = $this->decode((string) $exception->getResponse()?->getBody()); + $message = $responsePayload['message'] ?? $exception->getMessage(); + + throw new SmsProviderException((string) $message, $responsePayload, + outcomeUnknown: $method === 'POST' && ($exception->getResponse() === null || $exception->getResponse()->getStatusCode() >= 500)); + } catch (GuzzleException $exception) { + throw new SmsProviderException($exception->getMessage(), outcomeUnknown: $method === 'POST'); + } + + return $this->decode((string) $response->getBody()); + } + + private function timestamp(): int + { + if ($this->serverTimestamp !== null) { + return $this->serverTimestamp + time() - $this->timestampFetchedAt; + } + + try { + $response = $this->client->request('GET', $this->baseUrl().'/auth/time', [ + 'timeout' => (float) config('relais_sms.ovh.timeout', 20), + ]); + + $this->timestampFetchedAt = time(); + + return $this->serverTimestamp = (int) trim((string) $response->getBody()); + } catch (GuzzleException) { + return time(); + } + } + + private function signature(string $method, string $url, string $body, int $timestamp): string + { + return '$1$'.sha1(implode('+', [ + $this->requiredConfig('application_secret'), + $this->requiredConfig('consumer_key'), + strtoupper($method), + $url, + $body, + (string) $timestamp, + ])); + } + + private function baseUrl(): string + { + return match ((string) config('relais_sms.ovh.endpoint', 'ovh-eu')) { + 'ovh-ca' => 'https://ca.api.ovh.com/1.0', + 'ovh-eu' => 'https://eu.api.ovh.com/1.0', + default => throw new SmsProviderException('Endpoint OVH non pris en charge : utiliser ovh-eu ou ovh-ca.'), + }; + } + + private function requiredConfig(string $key): string + { + $value = trim((string) config('relais_sms.ovh.'.$key, '')); + + if ($value === '') { + throw new SmsProviderException('Configuration OVH incomplete : '.$key.'.'); + } + + return $value; + } + + /** + * @return array|array + */ + private function decode(string $body): array + { + if (trim($body) === '') { + return []; + } + + $decoded = json_decode($body, true); + + return is_array($decoded) ? $decoded : []; + } + + private function stringValue(mixed $value): ?string + { + if ($value === null || $value === '') { + return null; + } + + return (string) $value; + } + + /** + * @return array + */ + private function stringList(mixed $values): array + { + if (! is_array($values)) { + return []; + } + + return array_values(array_map('strval', $values)); + } +} diff --git a/app/Services/Sms/SmsCampaignReconciler.php b/app/Services/Sms/SmsCampaignReconciler.php new file mode 100644 index 0000000..b5681ad --- /dev/null +++ b/app/Services/Sms/SmsCampaignReconciler.php @@ -0,0 +1,99 @@ +provider->outgoing($campaign); + } catch (SmsProviderException $exception) { + Log::warning('SMS campaign verification unavailable.', [ + 'sms_campaign_id' => $campaign->id, + 'reason' => $exception->getMessage(), + ]); + + return $campaign; + } + + return $this->applyOutgoing($campaign, $messages); + } + + /** @param array> $messages */ + public function applyOutgoing(SmsCampaign $campaign, array $messages): SmsCampaign + { + return DB::transaction(function () use ($campaign, $messages): SmsCampaign { + $campaign = SmsCampaign::query()->lockForUpdate()->findOrFail($campaign->id); + + if (! in_array($campaign->status, ['uncertain', 'sending'], true)) { + return $campaign; + } + + $byNumber = []; + foreach ($messages as $message) { + if (($message['tag'] ?? null) !== $campaign->provider_tag + || ($message['message'] ?? null) !== $campaign->message + || empty($message['id']) || empty($message['receiver'])) { + continue; + } + + $byNumber[(string) $message['receiver']] = $message; + } + + foreach ($campaign->deliveries()->whereIn('status', ['uncertain', 'queued'])->get() as $delivery) { + $message = $byNumber[$delivery->number] ?? null; + if ($message === null) { + $delivery->update(['status' => 'uncertain']); + + continue; + } + + // "sent" records acceptance by OVH, not delivery to the handset. + $delivery->update([ + 'status' => 'sent', + 'provider_message_id' => (string) $message['id'], + 'provider_response' => $message, + 'error_message' => null, + 'sent_at' => $message['sentAt'] ?? $message['creationDatetime'] ?? now(), + ]); + } + + $sentCount = $campaign->deliveries()->where('status', 'sent')->count(); + $failedCount = $campaign->deliveries()->where('status', 'failed')->count(); + $unconfirmed = $campaign->deliveries()->whereIn('status', ['uncertain', 'queued'])->exists(); + $status = $unconfirmed ? 'uncertain' : ($failedCount > 0 ? ($sentCount > 0 ? 'partial' : 'failed') : 'sent'); + $campaign->update([ + 'status' => $status, + 'sent_count' => $sentCount, + 'failed_count' => $failedCount, + 'sent_at' => $campaign->deliveries()->where('status', 'sent')->min('sent_at'), + 'response_payload' => ['verification' => 'OVH outgoing history', 'confirmed_recipients' => $sentCount], + 'error_message' => $unconfirmed + ? 'Certains envois restent a verifier chez OVH. Aucun renvoi automatique ; ne pas renvoyer cette campagne.' + : null, + ]); + + CalendarReminder::query()->where('sms_campaign_id', $campaign->id)->where('status', 'uncertain')->update([ + 'status' => $status === 'uncertain' ? 'uncertain' : ($sentCount > 0 ? 'sent' : 'failed'), + 'last_error' => $campaign->error_message, + 'sent_at' => $campaign->sent_at, + ]); + + Log::info('SMS campaign verified against OVH history.', [ + 'sms_campaign_id' => $campaign->id, + 'sent_count' => $sentCount, + 'status' => $status, + ]); + + return $campaign->fresh(['deliveries', 'user']); + }); + } +} diff --git a/app/Services/Sms/SmsCampaignSender.php b/app/Services/Sms/SmsCampaignSender.php new file mode 100644 index 0000000..0714261 --- /dev/null +++ b/app/Services/Sms/SmsCampaignSender.php @@ -0,0 +1,260 @@ +> $recipients + * @param array $selectedContactIds + * @param array $selectedGroupIds + */ + public function send( + User $user, + string $message, + array $recipients, + array $selectedContactIds = [], + array $selectedGroupIds = [], + ): SmsCampaign { + $campaign = $this->createCampaign($user, $message, $recipients, $selectedContactIds, $selectedGroupIds, 'sending'); + + return $this->sendExistingCampaign($campaign, $recipients); + } + + /** + * @param array> $recipients + * @param array $selectedContactIds + * @param array $selectedGroupIds + */ + public function schedule( + User $user, + string $message, + array $recipients, + array $selectedContactIds, + array $selectedGroupIds, + CarbonInterface $scheduledAt, + ): SmsCampaign { + return $this->createCampaign($user, $message, $recipients, $selectedContactIds, $selectedGroupIds, 'scheduled', $scheduledAt); + } + + public function sendScheduled(SmsCampaign $campaign): ?SmsCampaign + { + $campaign = DB::transaction(function () use ($campaign): ?SmsCampaign { + $fresh = SmsCampaign::query() + ->whereKey($campaign->id) + ->lockForUpdate() + ->first(); + + if (! $fresh || $fresh->status !== 'scheduled') { + return null; + } + + $fresh->update(['status' => 'sending']); + + Log::info('SMS campaign status changed from scheduled to sending.', [ + 'sms_campaign_id' => $fresh->id, + 'scheduled_at' => $fresh->scheduled_at?->toIso8601String(), + ]); + + return $fresh->fresh(['deliveries', 'user']); + }); + + if ($campaign === null) { + return null; + } + + return $this->sendExistingCampaign($campaign, $this->recipientsFromDeliveries($campaign)); + } + + /** + * @param array> $recipients + * @param array $selectedContactIds + * @param array $selectedGroupIds + */ + private function createCampaign( + User $user, + string $message, + array $recipients, + array $selectedContactIds, + array $selectedGroupIds, + string $status, + ?CarbonInterface $scheduledAt = null, + ): SmsCampaign { + $selectedContactIds = $this->cleanIds($selectedContactIds); + $selectedGroupIds = $this->cleanIds($selectedGroupIds); + $selectedGroupNames = ContactGroup::query() + ->whereKey($selectedGroupIds) + ->orderBy('name') + ->pluck('name') + ->values() + ->all(); + + return $this->createResolvedCampaign( + $user, + $message, + $recipients, + $selectedContactIds, + $selectedGroupIds, + $selectedGroupNames, + $status, + $scheduledAt, + ); + } + + /** + * @param array> $recipients + * @param array $selectedContactIds + * @param array $selectedGroupIds + * @param array $selectedGroupNames + */ + private function createResolvedCampaign( + User $user, + string $message, + array $recipients, + array $selectedContactIds, + array $selectedGroupIds, + array $selectedGroupNames, + string $status, + ?CarbonInterface $scheduledAt, + ): SmsCampaign { + return DB::transaction(function () use ($user, $message, $recipients, $selectedContactIds, $selectedGroupIds, $selectedGroupNames, $status, $scheduledAt): SmsCampaign { + $attributes = [ + 'user_id' => $user->id, + 'provider' => (string) config('relais_sms.default_settings.active_sms_provider', 'ovh'), + 'status' => $status, + 'message' => $message, + 'recipients_count' => count($recipients), + 'selected_contact_ids' => $selectedContactIds, + 'selected_group_ids' => $selectedGroupIds, + 'selected_group_names' => $selectedGroupNames, + ]; + + if ($scheduledAt !== null) { + $attributes['scheduled_at'] = $scheduledAt; + } + + $campaign = SmsCampaign::query()->create($attributes); + $campaign->update(['provider_tag' => 'relais-sms-campaign-'.$campaign->id]); + + foreach ($recipients as $recipient) { + $campaign->deliveries()->create([ + 'contact_id' => $recipient['contact_id'] ?? null, + 'contact_phone_number_id' => $recipient['phone_number_id'] ?? null, + 'contact_name' => (string) $recipient['contact_name'], + 'number' => (string) $recipient['number'], + 'status' => 'queued', + ]); + } + + return $campaign; + }); + } + + /** + * @param array> $recipients + */ + private function sendExistingCampaign(SmsCampaign $campaign, array $recipients): SmsCampaign + { + try { + $result = $this->provider->send($campaign, $recipients); + } catch (SmsProviderException $exception) { + $status = $exception->outcomeUnknown ? 'uncertain' : 'failed'; + $message = $exception->outcomeUnknown + ? 'OVH n a pas confirme la reponse. Les SMS peuvent avoir ete envoyes. Verification automatique au prochain passage du cron ; ne pas renvoyer cette campagne.' + : $exception->getMessage(); + + DB::transaction(function () use ($campaign, $exception, $status, $message, $recipients): void { + $campaign->deliveries()->update(['status' => $status, 'error_message' => $message]); + $campaign->update([ + 'status' => $status, + 'failed_count' => $exception->outcomeUnknown ? 0 : count($recipients), + 'response_payload' => $exception->responsePayload, + 'error_message' => $message, + ]); + }); + + Log::warning('SMS provider request failed.', [ + 'sms_campaign_id' => $campaign->id, + 'outcome_unknown' => $exception->outcomeUnknown, + 'reason' => $exception->getMessage(), + ]); + + return $campaign->fresh(['deliveries', 'user']); + } + + $failedNumbers = array_flip($result->failedNumbers); + $sentCount = 0; + $failedCount = 0; + + foreach ($campaign->deliveries()->orderBy('id')->get()->values() as $index => $delivery) { + $failed = isset($failedNumbers[$delivery->number]); + + $delivery->update([ + 'status' => $failed ? 'failed' : 'sent', + 'provider_message_id' => $result->providerMessageIds[$index] ?? null, + 'provider_response' => $result->responsePayload, + 'error_message' => $failed ? 'Numero refuse par OVH.' : null, + 'sent_at' => $failed ? null : now(), + ]); + + $failed ? $failedCount++ : $sentCount++; + } + + $campaign->update([ + 'status' => $failedCount > 0 ? ($sentCount > 0 ? 'partial' : 'failed') : 'sent', + 'sent_count' => $sentCount, + 'failed_count' => $failedCount, + 'provider_service_name' => $result->serviceName, + 'provider_job_id' => $result->providerJobId, + 'message' => (string) ($result->requestPayload['message'] ?? $campaign->message), + 'request_payload' => $result->requestPayload, + 'response_payload' => $result->responsePayload, + 'sent_at' => $sentCount > 0 ? now() : null, + ]); + + return $campaign->fresh(['deliveries', 'user']); + } + + /** + * @return array> + */ + private function recipientsFromDeliveries(SmsCampaign $campaign): array + { + return $campaign->deliveries() + ->orderBy('id') + ->get() + ->map(fn (SmsDelivery $delivery): array => [ + 'contact_id' => $delivery->contact_id, + 'phone_number_id' => $delivery->contact_phone_number_id, + 'contact_name' => $delivery->contact_name, + 'number' => $delivery->number, + ]) + ->values() + ->all(); + } + + /** + * @param array $ids + * @return array + */ + private function cleanIds(array $ids): array + { + return collect($ids) + ->map(fn (int|string $id): int => (int) $id) + ->filter(fn (int $id): bool => $id > 0) + ->unique() + ->values() + ->all(); + } +} diff --git a/app/Services/Sms/SmsMessageComposer.php b/app/Services/Sms/SmsMessageComposer.php new file mode 100644 index 0000000..fbf9555 --- /dev/null +++ b/app/Services/Sms/SmsMessageComposer.php @@ -0,0 +1,39 @@ + AppSetting::string('sms_message_header'), + 'footer' => AppSetting::string('sms_message_footer'), + ]; + } + + public function compose(string $body, bool $includeHeader = true, bool $includeFooter = true): string + { + $settings = $this->settings(); + $parts = []; + + if ($includeHeader && $settings['header'] !== '') { + $parts[] = $settings['header']; + } + + if (trim($body) !== '') { + $parts[] = trim($body); + } + + if ($includeFooter && $settings['footer'] !== '') { + $parts[] = $settings['footer']; + } + + return implode("\n", $parts); + } +} diff --git a/app/Services/Sms/SmsMessageLength.php b/app/Services/Sms/SmsMessageLength.php new file mode 100644 index 0000000..0ab4e3b --- /dev/null +++ b/app/Services/Sms/SmsMessageLength.php @@ -0,0 +1,69 @@ +?\u{00A1}ABCDEFGHIJKLMNOPQRSTUVWXYZ\u{00C4}\u{00D6}\u{00D1}\u{00DC}\u{00A7}\u{00BF}abcdefghijklmnopqrstuvwxyz\u{00E4}\u{00F6}\u{00F1}\u{00FC}\u{00E0}"; + + private const GSM_EXTENDED = "^{}\\[~]|\u{20AC}"; + + public function fitsInOneSms(string $message): bool + { + return $this->units($message) <= $this->singleSmsCapacity($message); + } + + public function units(string $message): int + { + if (! $this->usesGsmAlphabet($message)) { + return intdiv(strlen(mb_convert_encoding($message, 'UTF-16BE', 'UTF-8')), 2); + } + + return array_sum(array_map( + fn (string $character): int => str_contains(self::GSM_EXTENDED, $character) ? 2 : 1, + mb_str_split($message), + )); + } + + public function singleSmsCapacity(string $message): int + { + return $this->usesGsmAlphabet($message) ? 160 : 70; + } + + /** + * Truncate a value so that prefix + value + suffix still fits in one SMS. + */ + public function truncateBetween(string $prefix, string $value, string $suffix, string $marker = '[...]'): string + { + if ($this->fitsInOneSms($prefix.$value.$suffix)) { + return $value; + } + + $truncated = ''; + + foreach (mb_str_split($value) as $character) { + if (! $this->fitsInOneSms($prefix.$truncated.$character.$marker.$suffix)) { + break; + } + + $truncated .= $character; + } + + if ($this->fitsInOneSms($prefix.$truncated.$marker.$suffix)) { + return rtrim($truncated).$marker; + } + + return rtrim($truncated); + } + + private function usesGsmAlphabet(string $message): bool + { + foreach (mb_str_split($message) as $character) { + if (! str_contains(self::GSM_BASIC, $character) && ! str_contains(self::GSM_EXTENDED, $character)) { + return false; + } + } + + return true; + } +} diff --git a/app/Services/Sms/SmsProviderException.php b/app/Services/Sms/SmsProviderException.php new file mode 100644 index 0000000..1c626ea --- /dev/null +++ b/app/Services/Sms/SmsProviderException.php @@ -0,0 +1,19 @@ +|null $responsePayload + */ + public function __construct( + string $message, + public readonly ?array $responsePayload = null, + public readonly bool $outcomeUnknown = false, + ) { + parent::__construct($message); + } +} diff --git a/app/Services/Sms/SmsSendResult.php b/app/Services/Sms/SmsSendResult.php new file mode 100644 index 0000000..1ecc434 --- /dev/null +++ b/app/Services/Sms/SmsSendResult.php @@ -0,0 +1,21 @@ + $requestPayload + * @param array $responsePayload + * @param array $providerMessageIds + * @param array $failedNumbers + */ + public function __construct( + public readonly string $serviceName, + public readonly ?string $providerJobId, + public readonly array $requestPayload, + public readonly array $responsePayload, + public readonly array $providerMessageIds = [], + public readonly array $failedNumbers = [], + ) {} +} diff --git a/artisan b/artisan new file mode 100755 index 0000000..c35e31d --- /dev/null +++ b/artisan @@ -0,0 +1,18 @@ +#!/usr/bin/env php +handleCommand(new ArgvInput); + +exit($status); diff --git a/bootstrap/app.php b/bootstrap/app.php new file mode 100644 index 0000000..f4b5434 --- /dev/null +++ b/bootstrap/app.php @@ -0,0 +1,23 @@ +withRouting( + web: __DIR__.'/../routes/web.php', + commands: __DIR__.'/../routes/console.php', + health: '/up', + ) + ->withMiddleware(function (Middleware $middleware): void { + $middleware->validateCsrfTokens(except: [ + 'ovh/sms/stop-callback', + ]); + }) + ->withExceptions(function (Exceptions $exceptions): void { + $exceptions->shouldRenderJsonWhen( + fn (Request $request) => $request->is('api/*'), + ); + })->create(); diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/bootstrap/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/bootstrap/providers.php b/bootstrap/providers.php new file mode 100644 index 0000000..fc94ae6 --- /dev/null +++ b/bootstrap/providers.php @@ -0,0 +1,7 @@ +=5.0.0" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2024-02-09T16:56:22+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dflydev\\DotAccessData\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "support": { + "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3" + }, + "time": "2024-07-08T12:26:09+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0 || ^13.0", + "phpstan/phpstan": "^1.12 || ^2.0", + "phpstan/phpstan-phpunit": "^1.4 || ^2.0", + "phpstan/phpstan-strict-rules": "^1.6 || ^2.0", + "phpunit/phpunit": "^8.5 || ^12.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "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" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.1.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%2Finflector", + "type": "tidelift" + } + ], + "time": "2025-08-10T19:31:58+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "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": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.1" + }, + "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%2Flexer", + "type": "tidelift" + } + ], + "time": "2024-02-05T11:56:58+00:00" + }, + { + "name": "dragonmantank/cron-expression", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/d61a8a9604ec1f8c3d150d09db6ce98b32675013", + "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013", + "shasum": "" + }, + "require": { + "php": "^8.2|^8.3|^8.4|^8.5" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.32|^2.1.31", + "phpunit/phpunit": "^8.5.48|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2025-10-31T18:51:33+00:00" + }, + { + "name": "egulias/email-validator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa", + "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^2.0 || ^3.0", + "php": ">=8.1", + "symfony/polyfill-intl-idn": "^1.26" + }, + "require-dev": { + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Egulias\\EmailValidator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails against several RFCs", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/egulias/EmailValidator/issues", + "source": "https://github.com/egulias/EmailValidator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2025-03-06T22:45:56+00:00" + }, + { + "name": "fruitcake/php-cors", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/fruitcake/php-cors.git", + "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379", + "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/http-foundation": "^5.4|^6.4|^7.3|^8" + }, + "require-dev": { + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^9", + "squizlabs/php_codesniffer": "^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Fruitcake\\Cors\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fruitcake", + "homepage": "https://fruitcake.nl" + }, + { + "name": "Barryvdh", + "email": "barryvdh@gmail.com" + } + ], + "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", + "homepage": "https://github.com/fruitcake/php-cors", + "keywords": [ + "cors", + "laravel", + "symfony" + ], + "support": { + "issues": "https://github.com/fruitcake/php-cors/issues", + "source": "https://github.com/fruitcake/php-cors/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2025-12-03T09:33:47+00:00" + }, + { + "name": "giggsey/libphonenumber-for-php", + "version": "9.0.32", + "source": { + "type": "git", + "url": "https://github.com/giggsey/libphonenumber-for-php.git", + "reference": "0945459d64ac6f583825bd5b9fa0645bfe791c72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/0945459d64ac6f583825bd5b9fa0645bfe791c72", + "reference": "0945459d64ac6f583825bd5b9fa0645bfe791c72", + "shasum": "" + }, + "require": { + "giggsey/locale": "^2.7", + "php": "^8.1", + "symfony/polyfill-mbstring": "^1.31" + }, + "replace": { + "giggsey/libphonenumber-for-php-lite": "self.version" + }, + "require-dev": { + "ext-dom": "*", + "friendsofphp/php-cs-fixer": "^3.71", + "infection/infection": "^0.29|^0.31.0", + "nette/php-generator": "^4.1", + "php-coveralls/php-coveralls": "^2.7", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.7", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan-phpunit": "^2.0.4", + "phpstan/phpstan-strict-rules": "^2.0.3", + "phpunit/phpunit": "^10.5.45", + "symfony/console": "^6.4", + "symfony/filesystem": "^6.4", + "symfony/process": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" + } + }, + "autoload": { + "psr-4": { + "libphonenumber\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Joshua Gigg", + "email": "giggsey@gmail.com", + "homepage": "https://giggsey.com/" + } + ], + "description": "A library for parsing, formatting, storing and validating international phone numbers, a PHP Port of Google's libphonenumber.", + "homepage": "https://github.com/giggsey/libphonenumber-for-php", + "keywords": [ + "geocoding", + "geolocation", + "libphonenumber", + "mobile", + "phonenumber", + "validation" + ], + "support": { + "issues": "https://github.com/giggsey/libphonenumber-for-php/issues", + "source": "https://github.com/giggsey/libphonenumber-for-php" + }, + "time": "2026-06-05T07:34:44+00:00" + }, + { + "name": "giggsey/locale", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/giggsey/Locale.git", + "reference": "fe741e99ae6ccbe8132f3d63d8ec89924e689778" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/giggsey/Locale/zipball/fe741e99ae6ccbe8132f3d63d8ec89924e689778", + "reference": "fe741e99ae6ccbe8132f3d63d8ec89924e689778", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "ext-json": "*", + "friendsofphp/php-cs-fixer": "^3.66", + "infection/infection": "^0.29|^0.32.0", + "php-coveralls/php-coveralls": "^2.7", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.7", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan-phpunit": "^2.0.4", + "phpstan/phpstan-strict-rules": "^2.0.3", + "phpunit/phpunit": "^10.5.45", + "symfony/console": "^6.4", + "symfony/filesystem": "^6.4", + "symfony/finder": "^6.4", + "symfony/process": "^6.4", + "symfony/var-exporter": "^6.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Giggsey\\Locale\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joshua Gigg", + "email": "giggsey@gmail.com", + "homepage": "https://giggsey.com/" + } + ], + "description": "Locale functions required by libphonenumber-for-php", + "support": { + "issues": "https://github.com/giggsey/Locale/issues", + "source": "https://github.com/giggsey/Locale/tree/2.9.0" + }, + "time": "2026-02-24T15:32:13+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.1.4", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b", + "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.5" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2025-12-27T19:43:20+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.11.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "5af96f374e0ab4ebd747b8310888c99d3adb0a8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/5af96f374e0ab4ebd747b8310888c99d3adb0a8c", + "reference": "5af96f374e0ab4ebd747b8310888c99d3adb0a8c", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^2.5", + "guzzlehttp/psr7": "^2.11", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.24" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "guzzlehttp/test-server": "^0.5", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.11.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2026-06-07T22:54:06+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "4360e982f87f5f258bf872d094647791db2f4c8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/4360e982f87f5f258bf872d094647791db2f4c8e", + "reference": "4360e982f87f5f258bf872d094647791db2f4c8e", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.5.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2026-06-02T12:23:43+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.11.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/bbb5e61349fa5cb822b3e87842b951088b76b81f", + "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.24" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "1.1.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.11.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2026-06-02T12:30:48+00:00" + }, + { + "name": "guzzlehttp/uri-template", + "version": "v1.0.7", + "source": { + "type": "git", + "url": "https://github.com/guzzle/uri-template.git", + "reference": "7fe811c23a9e3cd712b4389eaeb50b5456d8c529" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/7fe811c23a9e3cd712b4389eaeb50b5456d8c529", + "reference": "7fe811c23a9e3cd712b4389eaeb50b5456d8c529", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/polyfill-php80": "^1.24" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.52 || ^9.6.34", + "uri-template/tests": "1.0.0" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\UriTemplate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + } + ], + "description": "A polyfill class for uri_template of PHP", + "keywords": [ + "guzzlehttp", + "uri-template" + ], + "support": { + "issues": "https://github.com/guzzle/uri-template/issues", + "source": "https://github.com/guzzle/uri-template/tree/v1.0.7" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template", + "type": "tidelift" + } + ], + "time": "2026-06-12T21:33:43+00:00" + }, + { + "name": "laravel/framework", + "version": "v13.15.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/framework.git", + "reference": "7e23b2aa4e1133a43835c93a810b4bedc40e425b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/framework/zipball/7e23b2aa4e1133a43835c93a810b4bedc40e425b", + "reference": "7e23b2aa4e1133a43835c93a810b4bedc40e425b", + "shasum": "" + }, + "require": { + "brick/math": "^0.14.2 || ^0.15 || ^0.16 || ^0.17", + "composer-runtime-api": "^2.2", + "doctrine/inflector": "^2.0.5", + "dragonmantank/cron-expression": "^3.4", + "egulias/email-validator": "^4.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-session": "*", + "ext-tokenizer": "*", + "fruitcake/php-cors": "^1.3", + "guzzlehttp/guzzle": "^7.8.2", + "guzzlehttp/promises": "^2.0.3", + "guzzlehttp/uri-template": "^1.0", + "laravel/prompts": "^0.3.0", + "laravel/serializable-closure": "^2.0.10", + "league/commonmark": "^2.8.1", + "league/flysystem": "^3.25.1", + "league/flysystem-local": "^3.25.1", + "league/uri": "^7.5.1", + "monolog/monolog": "^3.0", + "nesbot/carbon": "^3.8.4", + "nunomaduro/termwind": "^2.0", + "php": "^8.3", + "psr/container": "^1.1.1 || ^2.0.1", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", + "ramsey/uuid": "^4.7", + "symfony/console": "^7.4.0 || ^8.0.0", + "symfony/error-handler": "^7.4.0 || ^8.0.0", + "symfony/finder": "^7.4.0 || ^8.0.0", + "symfony/http-foundation": "^7.4.0 || ^8.0.0", + "symfony/http-kernel": "^7.4.0 || ^8.0.0", + "symfony/mailer": "^7.4.0 || ^8.0.0", + "symfony/mime": "^7.4.0 || ^8.0.0", + "symfony/polyfill-php84": "^1.36", + "symfony/polyfill-php85": "^1.36", + "symfony/polyfill-php86": "^1.36", + "symfony/process": "^7.4.5 || ^8.0.5", + "symfony/routing": "^7.4.0 || ^8.0.0", + "symfony/uid": "^7.4.0 || ^8.0.0", + "symfony/var-dumper": "^7.4.0 || ^8.0.0", + "tijsverkoyen/css-to-inline-styles": "^2.2.5", + "vlucas/phpdotenv": "^5.6.1", + "voku/portable-ascii": "^2.0.2" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "provide": { + "psr/container-implementation": "1.1 || 2.0", + "psr/log-implementation": "1.0 || 2.0 || 3.0", + "psr/simple-cache-implementation": "1.0 || 2.0 || 3.0" + }, + "replace": { + "illuminate/auth": "self.version", + "illuminate/broadcasting": "self.version", + "illuminate/bus": "self.version", + "illuminate/cache": "self.version", + "illuminate/collections": "self.version", + "illuminate/concurrency": "self.version", + "illuminate/conditionable": "self.version", + "illuminate/config": "self.version", + "illuminate/console": "self.version", + "illuminate/container": "self.version", + "illuminate/contracts": "self.version", + "illuminate/cookie": "self.version", + "illuminate/database": "self.version", + "illuminate/encryption": "self.version", + "illuminate/events": "self.version", + "illuminate/filesystem": "self.version", + "illuminate/hashing": "self.version", + "illuminate/http": "self.version", + "illuminate/json-schema": "self.version", + "illuminate/log": "self.version", + "illuminate/macroable": "self.version", + "illuminate/mail": "self.version", + "illuminate/notifications": "self.version", + "illuminate/pagination": "self.version", + "illuminate/pipeline": "self.version", + "illuminate/process": "self.version", + "illuminate/queue": "self.version", + "illuminate/redis": "self.version", + "illuminate/reflection": "self.version", + "illuminate/routing": "self.version", + "illuminate/session": "self.version", + "illuminate/support": "self.version", + "illuminate/testing": "self.version", + "illuminate/translation": "self.version", + "illuminate/validation": "self.version", + "illuminate/view": "self.version", + "spatie/once": "*" + }, + "require-dev": { + "ably/ably-php": "^1.0", + "aws/aws-sdk-php": "^3.322.9", + "ext-gmp": "*", + "fakerphp/faker": "^1.24", + "guzzlehttp/psr7": "^2.9", + "laravel/pint": "^1.18", + "league/flysystem-aws-s3-v3": "^3.25.1", + "league/flysystem-ftp": "^3.25.1", + "league/flysystem-path-prefixing": "^3.25.1", + "league/flysystem-read-only": "^3.25.1", + "league/flysystem-sftp-v3": "^3.25.1", + "mockery/mockery": "^1.6.10", + "opis/json-schema": "^2.4.1", + "orchestra/testbench-core": "^11.0.0", + "pda/pheanstalk": "^7.0.0 || ^8.0.0", + "php-http/discovery": "^1.15", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^11.5.50 || ^12.5.8 || ^13.0.3", + "predis/predis": "^2.3 || ^3.0", + "rector/rector": "^2.3", + "resend/resend-php": "^1.0", + "symfony/cache": "^7.4.0 || ^8.0.0", + "symfony/http-client": "^7.4.0 || ^8.0.0", + "symfony/psr-http-message-bridge": "^7.4.0 || ^8.0.0", + "symfony/translation": "^7.4.0 || ^8.0.0" + }, + "suggest": { + "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", + "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.322.9).", + "brianium/paratest": "Required to run tests in parallel (^7.0 || ^8.0).", + "ext-apcu": "Required to use the APC cache driver.", + "ext-fileinfo": "Required to use the Filesystem class.", + "ext-ftp": "Required to use the Flysystem FTP driver.", + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", + "ext-memcached": "Required to use the memcache cache driver.", + "ext-pcntl": "Required to use all features of the queue worker and console signal trapping.", + "ext-pdo": "Required to use all database features.", + "ext-posix": "Required to use all features of the queue worker.", + "ext-redis": "Required to use the Redis cache and queue drivers (^4.0 || ^5.0 || ^6.0).", + "fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).", + "filp/whoops": "Required for friendly error pages in development (^2.14.3).", + "laravel/tinker": "Required to use the tinker console command (^2.0).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.25.1).", + "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.25.1).", + "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.25.1).", + "league/flysystem-read-only": "Required to use read-only disks (^3.25.1)", + "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.25.1).", + "mockery/mockery": "Required to use mocking (^1.6).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (^7.0 || ^8.0).", + "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).", + "phpunit/phpunit": "Required to use assertions and run tests (^11.5.50 || ^12.5.8 || ^13.0.3).", + "predis/predis": "Required to use the predis connector (^2.3 || ^3.0).", + "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0 || ^7.0).", + "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0 || ^1.0).", + "spatie/fork": "Required to use the 'fork' concurrency driver (^1.2).", + "symfony/cache": "Required to PSR-6 cache bridge (^7.4 || ^8.0).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^7.4 || ^8.0).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.4 || ^8.0).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.4 || ^8.0).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.4 || ^8.0).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.4 || ^8.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "13.0.x-dev" + } + }, + "autoload": { + "files": [ + "src/Illuminate/Collections/functions.php", + "src/Illuminate/Collections/helpers.php", + "src/Illuminate/Events/functions.php", + "src/Illuminate/Filesystem/functions.php", + "src/Illuminate/Foundation/helpers.php", + "src/Illuminate/Log/functions.php", + "src/Illuminate/Reflection/helpers.php", + "src/Illuminate/Support/functions.php", + "src/Illuminate/Support/helpers.php" + ], + "psr-4": { + "Illuminate\\": "src/Illuminate/", + "Illuminate\\Support\\": [ + "src/Illuminate/Macroable/", + "src/Illuminate/Collections/", + "src/Illuminate/Conditionable/", + "src/Illuminate/Reflection/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Laravel Framework.", + "homepage": "https://laravel.com", + "keywords": [ + "framework", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2026-06-09T13:45:51+00:00" + }, + { + "name": "laravel/prompts", + "version": "v0.3.18", + "source": { + "type": "git", + "url": "https://github.com/laravel/prompts.git", + "reference": "a19af51bb144bf87f08397921fa619f85c7d4e72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/prompts/zipball/a19af51bb144bf87f08397921fa619f85c7d4e72", + "reference": "a19af51bb144bf87f08397921fa619f85c7d4e72", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.2", + "ext-mbstring": "*", + "php": "^8.1", + "symfony/console": "^6.2|^7.0|^8.0" + }, + "conflict": { + "illuminate/console": ">=10.17.0 <10.25.0", + "laravel/framework": ">=10.17.0 <10.25.0" + }, + "require-dev": { + "illuminate/collections": "^10.0|^11.0|^12.0|^13.0", + "mockery/mockery": "^1.5", + "pestphp/pest": "^2.3|^3.4|^4.0", + "phpstan/phpstan": "^1.12.28", + "phpstan/phpstan-mockery": "^1.1.3" + }, + "suggest": { + "ext-pcntl": "Required for the spinner to be animated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.3.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Laravel\\Prompts\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Add beautiful and user-friendly forms to your command-line applications.", + "support": { + "issues": "https://github.com/laravel/prompts/issues", + "source": "https://github.com/laravel/prompts/tree/v0.3.18" + }, + "time": "2026-05-19T00:47:18+00:00" + }, + { + "name": "laravel/serializable-closure", + "version": "v2.0.13", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "b566ee0dd251f3c4078bed003a7ce015f5ea6dce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/b566ee0dd251f3c4078bed003a7ce015f5ea6dce", + "reference": "b566ee0dd251f3c4078bed003a7ce015f5ea6dce", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "illuminate/support": "^10.0|^11.0|^12.0|^13.0", + "nesbot/carbon": "^2.67|^3.0", + "pestphp/pest": "^2.36|^3.0|^4.0", + "phpstan/phpstan": "^2.0", + "symfony/var-dumper": "^6.2.0|^7.0.0|^8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\SerializableClosure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "nuno@laravel.com" + } + ], + "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", + "keywords": [ + "closure", + "laravel", + "serializable" + ], + "support": { + "issues": "https://github.com/laravel/serializable-closure/issues", + "source": "https://github.com/laravel/serializable-closure" + }, + "time": "2026-04-16T14:03:50+00:00" + }, + { + "name": "laravel/tinker", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/laravel/tinker.git", + "reference": "4faba77764bd33411735936acdf30446d058c78b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/tinker/zipball/4faba77764bd33411735936acdf30446d058c78b", + "reference": "4faba77764bd33411735936acdf30446d058c78b", + "shasum": "" + }, + "require": { + "illuminate/console": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "illuminate/contracts": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "php": "^8.1", + "psy/psysh": "^0.12.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0|^8.0" + }, + "require-dev": { + "mockery/mockery": "~1.3.3|^1.4.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5|^11.5" + }, + "suggest": { + "illuminate/database": "The Illuminate Database package (^8.0|^9.0|^10.0|^11.0|^12.0|^13.0)." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Tinker\\TinkerServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Tinker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Powerful REPL for the Laravel framework.", + "keywords": [ + "REPL", + "Tinker", + "laravel", + "psysh" + ], + "support": { + "issues": "https://github.com/laravel/tinker/issues", + "source": "https://github.com/laravel/tinker/tree/v3.0.2" + }, + "time": "2026-03-17T14:54:13+00:00" + }, + { + "name": "league/commonmark", + "version": "2.8.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "59fb075d2101740c337c7216e3f32b36c204218b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/59fb075d2101740c337c7216e3f32b36c204218b", + "reference": "59fb075d2101740c337c7216e3f32b36c204218b", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "league/config": "^1.1.1", + "php": "^7.4 || ^8.0", + "psr/event-dispatcher": "^1.0", + "symfony/deprecation-contracts": "^2.1 || ^3.0", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "cebe/markdown": "^1.0", + "commonmark/cmark": "0.31.1", + "commonmark/commonmark.js": "0.31.1", + "composer/package-versions-deprecated": "^1.8", + "embed/embed": "^4.4", + "erusev/parsedown": "^1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "^1.4 || ^2.0", + "nyholm/psr7": "^1.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", + "scrutinizer/ocular": "^1.8.1", + "symfony/finder": "^5.3 | ^6.0 | ^7.0 || ^8.0", + "symfony/process": "^5.4 | ^6.0 | ^7.0 || ^8.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0 || ^8.0", + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0 || ^5.0.0 || ^6.0.0" + }, + "suggest": { + "symfony/yaml": "v2.3+ required if using the Front Matter extension" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.9-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "flavored", + "gfm", + "github", + "github-flavored", + "markdown", + "md", + "parser" + ], + "support": { + "docs": "https://commonmark.thephpleague.com/", + "forum": "https://github.com/thephpleague/commonmark/discussions", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" + } + ], + "time": "2026-03-19T13:16:38+00:00" + }, + { + "name": "league/config", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/config.git", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^3.0.1", + "nette/schema": "^1.2", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Define configuration arrays with strict schemas and access values with dot notation", + "homepage": "https://config.thephpleague.com", + "keywords": [ + "array", + "config", + "configuration", + "dot", + "dot-access", + "nested", + "schema" + ], + "support": { + "docs": "https://config.thephpleague.com/", + "issues": "https://github.com/thephpleague/config/issues", + "rss": "https://github.com/thephpleague/config/releases.atom", + "source": "https://github.com/thephpleague/config" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + } + ], + "time": "2022-12-11T20:36:23+00:00" + }, + { + "name": "league/flysystem", + "version": "3.34.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e", + "reference": "2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e", + "shasum": "" + }, + "require": { + "league/flysystem-local": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "conflict": { + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", + "aws/aws-sdk-php": "3.209.31 || 3.210.0", + "guzzlehttp/guzzle": "<7.0", + "guzzlehttp/ringphp": "<1.1.1", + "phpseclib/phpseclib": "3.0.15", + "symfony/http-client": "<5.2" + }, + "require-dev": { + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", + "aws/aws-sdk-php": "^3.295.10", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "ext-ftp": "*", + "ext-mongodb": "^1.3|^2", + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.5", + "google/cloud-storage": "^1.23", + "guzzlehttp/psr7": "^2.6", + "microsoft/azure-storage-blob": "^1.1", + "mongodb/mongodb": "^1.2|^2", + "phpseclib/phpseclib": "^3.0.36", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.11|^10.0", + "sabre/dav": "^4.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "File storage abstraction for PHP", + "keywords": [ + "WebDAV", + "aws", + "cloud", + "file", + "files", + "filesystem", + "filesystems", + "ftp", + "s3", + "sftp", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/3.34.0" + }, + "time": "2026-05-14T10:28:08+00:00" + }, + { + "name": "league/flysystem-local", + "version": "3.31.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-local.git", + "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/2f669db18a4c20c755c2bb7d3a7b0b2340488079", + "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\Local\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Local filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "file", + "files", + "filesystem", + "local" + ], + "support": { + "source": "https://github.com/thephpleague/flysystem-local/tree/3.31.0" + }, + "time": "2026-01-23T15:30:45+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.16.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/2d6702ff215bf922936ccc1ad31007edc76451b9", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2024-09-21T08:32:55+00:00" + }, + { + "name": "league/uri", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri.git", + "reference": "08cf38e3924d4f56238125547b5720496fac8fd4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/08cf38e3924d4f56238125547b5720496fac8fd4", + "reference": "08cf38e3924d4f56238125547b5720496fac8fd4", + "shasum": "" + }, + "require": { + "league/uri-interfaces": "^7.8.1", + "php": "^8.1", + "psr/http-factory": "^1" + }, + "conflict": { + "league/uri-schemes": "^1.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-dom": "to convert the URI into an HTML anchor tag", + "ext-fileinfo": "to create Data URI from file contennts", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "ext-uri": "to use the PHP native URI class", + "jeremykendall/php-domain-parser": "to further parse the URI host and resolve its Public Suffix and Top Level Domain", + "league/uri-components": "to provide additional tools to manipulate URI objects components", + "league/uri-polyfill": "to backport the PHP URI extension for older versions of PHP", + "php-64bit": "to improve IPV4 host parsing", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "URI manipulation library", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "URN", + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc2141", + "rfc3986", + "rfc3987", + "rfc6570", + "rfc8141", + "uri", + "uri-template", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2026-03-15T20:22:25+00:00" + }, + { + "name": "league/uri-interfaces", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/85d5c77c5d6d3af6c54db4a78246364908f3c928", + "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^8.1", + "psr/http-message": "^1.1 || ^2.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "php-64bit": "to improve IPV4 host parsing", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "Common tools for parsing and resolving RFC3987/RFC3986 URI", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri-interfaces/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2026-03-08T20:05:35+00:00" + }, + { + "name": "monolog/monolog", + "version": "3.10.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b321dd6749f0bf7189444158a3ce785cc16d69b0", + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8 || ^2.0", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "php-console/php-console": "^3.1.8", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^10.5.17 || ^11.0.7", + "predis/predis": "^1.1 || ^2", + "rollbar/rollbar": "^4.0", + "ruflin/elastica": "^7 || ^8", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/3.10.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2026-01-02T08:56:05+00:00" + }, + { + "name": "nesbot/carbon", + "version": "3.11.4", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon.git", + "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/e890471a3494740f7d9326d72ce6a8c559ffee60", + "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60", + "shasum": "" + }, + "require": { + "carbonphp/carbon-doctrine-types": "<100.0", + "ext-json": "*", + "php": "^8.1", + "psr/clock": "^1.0", + "symfony/clock": "^6.3.12 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0 || ^8.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^3.6.3 || ^4.0", + "doctrine/orm": "^2.15.2 || ^3.0", + "friendsofphp/php-cs-fixer": "^v3.87.1", + "kylekatarnls/multi-tester": "^2.5.3", + "phpmd/phpmd": "^2.15.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.22", + "phpunit/phpunit": "^10.5.53", + "squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbonphp.github.io/carbon/", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbonphp.github.io/carbon/guide/getting-started/introduction.html", + "issues": "https://github.com/CarbonPHP/carbon/issues", + "source": "https://github.com/CarbonPHP/carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2026-04-07T09:57:54+00:00" + }, + { + "name": "nette/schema", + "version": "v1.3.5", + "source": { + "type": "git", + "url": "https://github.com/nette/schema.git", + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/schema/zipball/f0ab1a3cda782dbc5da270d28545236aa80c4002", + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002", + "shasum": "" + }, + "require": { + "nette/utils": "^4.0", + "php": "8.1 - 8.5" + }, + "require-dev": { + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.6", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1.39@stable", + "tracy/tracy": "^2.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", + "keywords": [ + "config", + "nette" + ], + "support": { + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.3.5" + }, + "time": "2026-02-23T03:47:12+00:00" + }, + { + "name": "nette/utils", + "version": "v4.1.4", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/7da6c396d7ebe142bc857c20479d5e70a5e1aac7", + "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7", + "shasum": "" + }, + "require": { + "php": "8.2 - 8.5" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "^1.2", + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.5", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1@stable", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.1.4" + }, + "time": "2026-05-11T20:49:54+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.7.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" + }, + "time": "2025-12-06T11:56:16+00:00" + }, + { + "name": "nunomaduro/termwind", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/712a31b768f5daea284c2169a7d227031001b9a8", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.4.4 || ^8.0.4" + }, + "require-dev": { + "illuminate/console": "^11.47.0", + "laravel/pint": "^1.27.1", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.3.2", + "phpstan/phpstan": "^1.12.32", + "phpstan/phpstan-strict-rules": "^1.6.2", + "symfony/var-dumper": "^7.3.5 || ^8.0.4", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Termwind\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "It's like Tailwind CSS, but for the console.", + "keywords": [ + "cli", + "console", + "css", + "package", + "php", + "style" + ], + "support": { + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/xiCO2k", + "type": "github" + } + ], + "time": "2026-02-16T23:10:27+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.9.5", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be", + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.9.5" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2025-12-27T19:41:33+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.12.23", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "4dcc0f08047d52bbde475eda481146fd8e27e1a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4dcc0f08047d52bbde475eda481146fd8e27e1a4", + "reference": "4dcc0f08047d52bbde475eda481146fd8e27e1a4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "^5.0 || ^4.0", + "php": "^8.0 || ^7.4", + "symfony/console": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4", + "symfony/var-dumper": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4" + }, + "conflict": { + "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "composer/class-map-generator": "^1.6" + }, + "suggest": { + "composer/class-map-generator": "Improved tab completion performance with better class discovery.", + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": false, + "forward-command": false + }, + "branch-alias": { + "dev-main": "0.12.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "https://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.12.23" + }, + "time": "2026-05-23T13:41:31+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.45", + "fakerphp/faker": "^1.24", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^2.1", + "mockery/mockery": "^1.6", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpspec/prophecy-phpunit": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5", + "ramsey/coding-standard": "^2.3", + "ramsey/conventional-commits": "^1.6", + "roave/security-advisories": "dev-latest" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.1.1" + }, + "time": "2025-03-22T05:38:12+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.9.2", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "8429c78ca35a09f27565311b98101e2826affde0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/8429c78ca35a09f27565311b98101e2826affde0", + "reference": "8429c78ca35a09f27565311b98101e2826affde0", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.25", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.9.2" + }, + "time": "2025-12-14T04:43:48+00:00" + }, + { + "name": "sabre/uri", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/uri.git", + "reference": "a926c749dddfb289b8a9b5218d16ac06affdc631" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/uri/zipball/a926c749dddfb289b8a9b5218d16ac06affdc631", + "reference": "a926c749dddfb289b8a9b5218d16ac06affdc631", + "shasum": "" + }, + "require": { + "php": "^8.2" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.95", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^10.5", + "rector/rector": "^2.4" + }, + "type": "library", + "autoload": { + "files": [ + "lib/functions.php" + ], + "psr-4": { + "Sabre\\Uri\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "Functions for making sense out of URIs.", + "homepage": "http://sabre.io/uri/", + "keywords": [ + "rfc3986", + "uri", + "url" + ], + "support": { + "forum": "https://groups.google.com/group/sabredav-discuss", + "issues": "https://github.com/sabre-io/uri/issues", + "source": "https://github.com/fruux/sabre-uri" + }, + "time": "2026-04-26T04:19:03+00:00" + }, + { + "name": "sabre/vobject", + "version": "4.6.1", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/vobject.git", + "reference": "63613f6c53a0a2bddfe22caba0d052e6c59f7d0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/vobject/zipball/63613f6c53a0a2bddfe22caba0d052e6c59f7d0e", + "reference": "63613f6c53a0a2bddfe22caba0d052e6c59f7d0e", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0", + "sabre/xml": "^2.1 || ^3.0 || ^4.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.17.1", + "phpstan/phpstan": "^0.12 || ^1.12 || ^2.0", + "phpunit/php-invoker": "^2.0 || ^3.1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" + }, + "suggest": { + "hoa/bench": "If you would like to run the benchmark scripts" + }, + "bin": [ + "bin/vobject", + "bin/generate_vcards" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Sabre\\VObject\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + }, + { + "name": "Dominik Tobschall", + "email": "dominik@fruux.com", + "homepage": "http://tobschall.de/", + "role": "Developer" + }, + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net", + "homepage": "http://mnt.io/", + "role": "Developer" + } + ], + "description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects", + "homepage": "http://sabre.io/vobject/", + "keywords": [ + "availability", + "freebusy", + "iCalendar", + "ical", + "ics", + "jCal", + "jCard", + "recurrence", + "rfc2425", + "rfc2426", + "rfc2739", + "rfc4770", + "rfc5545", + "rfc5546", + "rfc6321", + "rfc6350", + "rfc6351", + "rfc6474", + "rfc6638", + "rfc6715", + "rfc6868", + "vCalendar", + "vCard", + "vcf", + "xCal", + "xCard" + ], + "support": { + "forum": "https://groups.google.com/group/sabredav-discuss", + "issues": "https://github.com/sabre-io/vobject/issues", + "source": "https://github.com/fruux/sabre-vobject" + }, + "time": "2026-07-07T03:20:17+00:00" + }, + { + "name": "sabre/xml", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/xml.git", + "reference": "bec83cbe2f4e1e1ca4254ed8d7caa7e32cc74b05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/xml/zipball/bec83cbe2f4e1e1ca4254ed8d7caa7e32cc74b05", + "reference": "bec83cbe2f4e1e1ca4254ed8d7caa7e32cc74b05", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "lib-libxml": ">=2.6.20", + "php": "^8.2", + "sabre/uri": ">=2.0,<4.0.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.95", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^10.5", + "rector/rector": "^2.4" + }, + "type": "library", + "autoload": { + "files": [ + "lib/Deserializer/functions.php", + "lib/Serializer/functions.php" + ], + "psr-4": { + "Sabre\\Xml\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + }, + { + "name": "Markus Staab", + "email": "markus.staab@redaxo.de", + "role": "Developer" + } + ], + "description": "sabre/xml is an XML library that you may not hate.", + "homepage": "https://sabre.io/xml/", + "keywords": [ + "XMLReader", + "XMLWriter", + "dom", + "xml" + ], + "support": { + "forum": "https://groups.google.com/group/sabredav-discuss", + "issues": "https://github.com/sabre-io/xml/issues", + "source": "https://github.com/fruux/sabre-xml" + }, + "time": "2026-04-27T10:56:01+00:00" + }, + { + "name": "symfony/clock", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/clock.git", + "reference": "674fa3b98e21531dd040e613479f5f6fa8f32111" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/clock/zipball/674fa3b98e21531dd040e613479f5f6fa8f32111", + "reference": "674fa3b98e21531dd040e613479f5f6fa8f32111", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/clock": "^1.0", + "symfony/polyfill-php83": "^1.28" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/now.php" + ], + "psr-4": { + "Symfony\\Component\\Clock\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Decouples applications from the system clock", + "homepage": "https://symfony.com", + "keywords": [ + "clock", + "psr20", + "time" + ], + "support": { + "source": "https://github.com/symfony/clock/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/console", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "85095d2573eaefaf35e40b9513a9bf09f72cd217" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/85095d2573eaefaf35e40b9513a9bf09f72cd217", + "reference": "85095d2573eaefaf35e40b9513a9bf09f72cd217", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.2|^8.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/lock": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-24T08:56:14+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v7.4.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "b75663ed96cf4756e28e3105476f220f92886cc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b75663ed96cf4756e28e3105476f220f92886cc4", + "reference": "b75663ed96cf4756e28e3105476f220f92886cc4", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Converts CSS selectors to XPath expressions", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/css-selector/tree/v7.4.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-18T13:18:21+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/50f59d1f3ca46d41ac911f97a78626b6756af35b", + "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-13T15:52:40+00:00" + }, + { + "name": "symfony/error-handler", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/error-handler.git", + "reference": "8dd79d8af777ee6cba2fd4d98da6ffb839f3c0fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/8dd79d8af777ee6cba2fd4d98da6ffb839f3c0fa", + "reference": "8dd79d8af777ee6cba2fd4d98da6ffb839f3c0fa", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/polyfill-php85": "^1.32", + "symfony/var-dumper": "^6.4|^7.0|^8.0" + }, + "conflict": { + "symfony/deprecation-contracts": "<2.5", + "symfony/http-kernel": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/serializer": "^6.4|^7.0|^8.0", + "symfony/webpack-encore-bundle": "^1.0|^2.0" + }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to manage errors and ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.4.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "e4a2e29753c7801f7a8340e066cfa788f3bc8101" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e4a2e29753c7801f7a8340e066cfa788f3bc8101", + "reference": "e4a2e29753c7801f7a8340e066cfa788f3bc8101", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/error-handler": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/framework-bundle": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-18T13:18:21+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "ccba7060602b7fed0b03c85bf025257f76d9ef32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/ccba7060602b7fed0b03c85bf025257f76d9ef32", + "reference": "ccba7060602b7fed0b03c85bf025257f76d9ef32", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-01-05T13:30:16+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "e0be088d22278583a82da281886e8c3592fbf149" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/e0be088d22278583a82da281886e8c3592fbf149", + "reference": "e0be088d22278583a82da281886e8c3592fbf149", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "bc354f47c62301e990b7874fa662326368508e2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/bc354f47c62301e990b7874fa662326368508e2c", + "reference": "bc354f47c62301e990b7874fa662326368508e2c", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "^1.1" + }, + "conflict": { + "doctrine/dbal": "<3.6", + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" + }, + "require-dev": { + "doctrine/dbal": "^3.6|^4", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^6.4.12|^7.1.5|^8.0", + "symfony/clock": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/mime": "^6.4|^7.0|^8.0", + "symfony/rate-limiter": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-24T11:20:33+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "9df847980c436451f4f51d1284491bb4356dd989" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9df847980c436451f4f51d1284491bb4356dd989", + "reference": "9df847980c436451f4f51d1284491bb4356dd989", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/error-handler": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^7.3|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/browser-kit": "<6.4", + "symfony/cache": "<6.4", + "symfony/config": "<6.4", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/doctrine-bridge": "<6.4", + "symfony/flex": "<2.10", + "symfony/form": "<6.4", + "symfony/http-client": "<6.4", + "symfony/http-client-contracts": "<2.5", + "symfony/mailer": "<6.4", + "symfony/messenger": "<6.4", + "symfony/translation": "<6.4", + "symfony/translation-contracts": "<2.5", + "symfony/twig-bridge": "<6.4", + "symfony/validator": "<6.4", + "symfony/var-dumper": "<6.4", + "twig/twig": "<3.12" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^6.4|^7.0|^8.0", + "symfony/clock": "^6.4|^7.0|^8.0", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/css-selector": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4.1|^7.0.1|^8.0", + "symfony/dom-crawler": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/finder": "^6.4|^7.0|^8.0", + "symfony/http-client-contracts": "^2.5|^3", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/property-access": "^7.1|^8.0", + "symfony/routing": "^6.4|^7.0|^8.0", + "symfony/serializer": "^7.1|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/translation": "^6.4|^7.0|^8.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^6.4|^7.0|^8.0", + "symfony/validator": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0", + "symfony/var-exporter": "^6.4|^7.0|^8.0", + "twig/twig": "^3.12" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "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/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-27T08:31:43+00:00" + }, + { + "name": "symfony/mailer", + "version": "v7.4.12", + "source": { + "type": "git", + "url": "https://github.com/symfony/mailer.git", + "reference": "5cefb712a25f320579615ba9e1942abaeade7dff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mailer/zipball/5cefb712a25f320579615ba9e1942abaeade7dff", + "reference": "5cefb712a25f320579615ba9e1942abaeade7dff", + "shasum": "" + }, + "require": { + "egulias/email-validator": "^2.1.10|^3|^4", + "php": ">=8.2", + "psr/event-dispatcher": "^1", + "psr/log": "^1|^2|^3", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/mime": "^7.2|^8.0", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<6.4", + "symfony/messenger": "<6.4", + "symfony/mime": "<6.4", + "symfony/twig-bridge": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/twig-bridge": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mailer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps sending emails", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/mailer/tree/v7.4.12" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-20T07:20:23+00:00" + }, + { + "name": "symfony/mime", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "a845722765c4f6b2ce88beaf4f4479975b186770" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/a845722765c4f6b2ce88beaf4f4479975b186770", + "reference": "a845722765c4f6b2ce88beaf4f4479975b186770", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<5.2|>=7", + "phpdocumentor/type-resolver": "<1.5.1", + "symfony/mailer": "<6.4", + "symfony/serializer": "<6.4.3|>7.0,<7.0.3" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10|^3.1|^4", + "league/html-to-markdown": "^5.0", + "phpdocumentor/reflection-docblock": "^5.2|^6.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/property-access": "^6.4|^7.0|^8.0", + "symfony/property-info": "^6.4|^7.0|^8.0", + "symfony/serializer": "^6.4.3|^7.0.3|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mime\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows manipulating MIME messages", + "homepage": "https://symfony.com", + "keywords": [ + "mime", + "mime-type" + ], + "support": { + "source": "https://github.com/symfony/mime/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-23T16:22:37+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "e9247d281d694a5120554d9afaf54e070e88a603" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/e9247d281d694a5120554d9afaf54e070e88a603", + "reference": "e9247d281d694a5120554d9afaf54e070e88a603", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T05:58:03+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "dc21118016c039a66235cf93d96b435ffb282412" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/dc21118016c039a66235cf93d96b435ffb282412", + "reference": "dc21118016c039a66235cf93d96b435ffb282412", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-25T15:22:23+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.38.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-25T13:48:31+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.38.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-27T06:59:30+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.38.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "796a26abb75ce49f3a84433cd81bf1009d73d5f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/796a26abb75ce49f3a84433cd81bf1009d73d5f8", + "reference": "796a26abb75ce49f3a84433cd81bf1009d73d5f8", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.38.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-27T06:51:48+00:00" + }, + { + "name": "symfony/polyfill-php84", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php84/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T12:51:13+00:00" + }, + { + "name": "symfony/polyfill-php85", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1", + "reference": "ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php85\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php85/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T02:25:22+00:00" + }, + { + "name": "symfony/polyfill-php86", + "version": "v1.38.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php86.git", + "reference": "fcec68d64f46dc84e1f6ffcf2c6dda40ff3143ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php86/zipball/fcec68d64f46dc84e1f6ffcf2c6dda40ff3143ad", + "reference": "fcec68d64f46dc84e1f6ffcf2c6dda40ff3143ad", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php86\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php86/tree/v1.38.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-25T11:52:35+00:00" + }, + { + "name": "symfony/polyfill-uuid", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-uuid.git", + "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/26dfec253c4cf3e51b541b52ddf7e42cb0908e94", + "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-uuid": "*" + }, + "suggest": { + "ext-uuid": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Uuid\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for uuid functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/process", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "f5804be144caceb570f6747519999636b664f24c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/f5804be144caceb570f6747519999636b664f24c", + "reference": "f5804be144caceb570f6747519999636b664f24c", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-23T16:05:06+00:00" + }, + { + "name": "symfony/routing", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "3a162171bb008e5e0f15dce6581373a4c0e8390d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/3a162171bb008e5e0f15dce6581373a4c0e8390d", + "reference": "3a162171bb008e5e0f15dce6581373a4c0e8390d", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/config": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/yaml": "<6.4" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/yaml": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Maps an HTTP request to a set of configuration variables", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "support": { + "source": "https://github.com/symfony/routing/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-24T11:20:33+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d25d82433a80eba6aa0e6c24b61d7370d99e444a", + "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-28T09:44:51+00:00" + }, + { + "name": "symfony/string", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "961683010db3b27ec6ebcd7308e6e1ee8fa7ffde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/961683010db3b27ec6ebcd7308e6e1ee8fa7ffde", + "reference": "961683010db3b27ec6ebcd7308e6e1ee8fa7ffde", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.33", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.1|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/intl": "^6.4|^7.0|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-23T15:23:29+00:00" + }, + { + "name": "symfony/translation", + "version": "v7.4.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "ada7578c30dd5feaa8259cff3e885069ea81ddde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/ada7578c30dd5feaa8259cff3e885069ea81ddde", + "reference": "ada7578c30dd5feaa8259cff3e885069ea81ddde", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^2.5.3|^3.3" + }, + "conflict": { + "nikic/php-parser": "<5.0", + "symfony/config": "<6.4", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<6.4", + "symfony/service-contracts": "<2.5", + "symfony/twig-bundle": "<6.4", + "symfony/yaml": "<6.4" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "require-dev": { + "nikic/php-parser": "^5.0", + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/finder": "^6.4|^7.0|^8.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/intl": "^6.4|^7.0|^8.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^6.4|^7.0|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v7.4.10" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-06T11:19:24+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "0ab302977a952b42fd51475c4ebac81f8da0a95d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/0ab302977a952b42fd51475c4ebac81f8da0a95d", + "reference": "0ab302977a952b42fd51475c4ebac81f8da0a95d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-01-05T13:30:16+00:00" + }, + { + "name": "symfony/uid", + "version": "v7.4.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/uid.git", + "reference": "2676b524340abcfe4d6151ec698463cebafee439" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/uid/zipball/2676b524340abcfe4d6151ec698463cebafee439", + "reference": "2676b524340abcfe4d6151ec698463cebafee439", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-uuid": "^1.15" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Uid\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to generate and represent UIDs", + "homepage": "https://symfony.com", + "keywords": [ + "UID", + "ulid", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/uid/tree/v7.4.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-30T15:19:22+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "9510c3966f749a1d1ff0059e1eabef6cc621e7fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9510c3966f749a1d1ff0059e1eabef6cc621e7fd", + "reference": "9510c3966f749a1d1ff0059e1eabef6cc621e7fd", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/console": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/uid": "^6.4|^7.0|^8.0", + "twig/twig": "^3.12" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-30T13:44:50+00:00" + }, + { + "name": "tijsverkoyen/css-to-inline-styles", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", + "reference": "f0292ccf0ec75843d65027214426b6b163b48b41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/f0292ccf0ec75843d65027214426b6b163b48b41", + "reference": "f0292ccf0ec75843d65027214426b6b163b48b41", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "php": "^7.4 || ^8.0", + "symfony/css-selector": "^5.4 || ^6.0 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^8.5.21 || ^9.5.10" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "TijsVerkoyen\\CssToInlineStyles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Tijs Verkoyen", + "email": "css_to_inline_styles@verkoyen.eu", + "role": "Developer" + } + ], + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", + "support": { + "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.4.0" + }, + "time": "2025-12-02T11:56:42+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.6.3", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "955e7815d677a3eaa7075231212f2110983adecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc", + "reference": "955e7815d677a3eaa7075231212f2110983adecc", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "graham-campbell/result-type": "^1.1.4", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.5", + "symfony/polyfill-ctype": "^1.26", + "symfony/polyfill-mbstring": "^1.26", + "symfony/polyfill-php80": "^1.26" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-filter": "*", + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator." + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "5.6-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "https://github.com/vlucas" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2025-12-27T19:49:13+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "8e1051fe39379367aecf014f41744ce7539a856f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/8e1051fe39379367aecf014f41744ce7539a856f", + "reference": "8e1051fe39379367aecf014f41744ce7539a856f", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpunit/phpunit": "~8.5 || ~9.6 || ~10.5 || ~11.5" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "https://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/2.1.1" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2026-04-26T05:33:54+00:00" + } + ], + "packages-dev": [ + { + "name": "fakerphp/faker", + "version": "v1.24.1", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "doctrine/persistence": "^1.3 || ^2.0", + "ext-intl": "*", + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" + }, + "suggest": { + "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" + }, + "time": "2024-11-21T13:46:39+00:00" + }, + { + "name": "filp/whoops", + "version": "2.18.4", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d", + "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.18.4" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2025-08-08T12:00:00+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.1.1", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.1.1" + }, + "time": "2025-04-30T06:54:44+00:00" + }, + { + "name": "laravel/agent-detector", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/laravel/agent-detector.git", + "reference": "90694b9256099591cf9e55d08c18ba7a00bf099f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/agent-detector/zipball/90694b9256099591cf9e55d08c18ba7a00bf099f", + "reference": "90694b9256099591cf9e55d08c18ba7a00bf099f", + "shasum": "" + }, + "require": { + "php": "^8.2.0" + }, + "require-dev": { + "laravel/pint": "^1.24.0", + "pestphp/pest": "^3.8.5|^4.1.0", + "pestphp/pest-plugin-type-coverage": "^3.0|^4.0.2", + "phpstan/phpstan": "^2.1.26", + "rector/rector": "^2.1.7", + "symfony/var-dumper": "^7.3.3" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Laravel\\AgentDetector\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Detect if code is running in an AI agent or automated development environment", + "homepage": "https://github.com/laravel/agent-detector", + "keywords": [ + "Agent", + "ai", + "automation", + "claude", + "cursor", + "detection", + "devin", + "php" + ], + "support": { + "issues": "https://github.com/laravel/agent-detector/issues", + "source": "https://github.com/laravel/agent-detector" + }, + "time": "2026-04-29T18:32:34+00:00" + }, + { + "name": "laravel/pail", + "version": "v1.2.7", + "source": { + "type": "git", + "url": "https://github.com/laravel/pail.git", + "reference": "2f7d27dada8effc48b8c424445a69cca7007daaa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pail/zipball/2f7d27dada8effc48b8c424445a69cca7007daaa", + "reference": "2f7d27dada8effc48b8c424445a69cca7007daaa", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "illuminate/console": "^10.24|^11.0|^12.0|^13.0", + "illuminate/contracts": "^10.24|^11.0|^12.0|^13.0", + "illuminate/log": "^10.24|^11.0|^12.0|^13.0", + "illuminate/process": "^10.24|^11.0|^12.0|^13.0", + "illuminate/support": "^10.24|^11.0|^12.0|^13.0", + "nunomaduro/termwind": "^1.15|^2.0", + "php": "^8.2", + "symfony/console": "^6.0|^7.0|^8.0" + }, + "require-dev": { + "laravel/framework": "^10.24|^11.0|^12.0|^13.0", + "laravel/pint": "^1.13", + "orchestra/testbench-core": "^8.13|^9.17|^10.8|^11.0", + "pestphp/pest": "^2.20|^3.0|^4.0", + "pestphp/pest-plugin-type-coverage": "^2.3|^3.0|^4.0", + "phpstan/phpstan": "^1.12.27", + "symfony/var-dumper": "^6.3|^7.0|^8.0", + "symfony/yaml": "^6.3|^7.0|^8.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Pail\\PailServiceProvider" + ] + }, + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Pail\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Easily delve into your Laravel application's log files directly from the command line.", + "homepage": "https://github.com/laravel/pail", + "keywords": [ + "dev", + "laravel", + "logs", + "php", + "tail" + ], + "support": { + "issues": "https://github.com/laravel/pail/issues", + "source": "https://github.com/laravel/pail" + }, + "time": "2026-05-20T22:24:57+00:00" + }, + { + "name": "laravel/pao", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/pao.git", + "reference": "8f6c8094d701a03041c85ba583ca233398c792ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pao/zipball/8f6c8094d701a03041c85ba583ca233398c792ec", + "reference": "8f6c8094d701a03041c85ba583ca233398c792ec", + "shasum": "" + }, + "require": { + "laravel/agent-detector": "^2.0.2", + "php": "^8.3" + }, + "conflict": { + "laravel/framework": "<12.0.0", + "nunomaduro/collision": "<8.9.3", + "pestphp/pest": "<4.6.3 || >=6.0.0", + "phpunit/phpunit": "<12.5.23 || >=13.0.0 <13.1.7 || >=14.0.0" + }, + "require-dev": { + "brianium/paratest": "^7.20.0", + "laravel/pint": "^1.29.1", + "orchestra/testbench": "^10.11.0 || ^11.1.0", + "pestphp/pest": "^4.7.2 || ^5.0.0", + "pestphp/pest-plugin-type-coverage": "^4.0.4 || ^5.0.0", + "phpstan/phpstan": "^2.2.2", + "rector/rector": "^2.4.5", + "symfony/process": "^7.4.8 || ^8.1.0", + "symfony/var-dumper": "^7.4.8 || ^8.1.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Laravel\\Pao\\Drivers\\Pest\\Plugin" + ] + }, + "laravel": { + "providers": [ + "Laravel\\Pao\\Laravel\\ServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/Autoload.php" + ], + "psr-4": { + "Laravel\\Pao\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Agent-optimized output for PHP testing tools", + "keywords": [ + "Agent", + "PHPStan", + "ai", + "dev", + "paratest", + "pest", + "php", + "phpunit", + "rector", + "testing" + ], + "support": { + "issues": "https://github.com/laravel/pao/issues", + "source": "https://github.com/laravel/pao" + }, + "time": "2026-06-12T08:00:22+00:00" + }, + { + "name": "laravel/pint", + "version": "v1.29.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "0770e9b7fafd50d4586881d456d6eb41c9247a80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/0770e9b7fafd50d4586881d456d6eb41c9247a80", + "reference": "0770e9b7fafd50d4586881d456d6eb41c9247a80", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.95.1", + "illuminate/view": "^12.56.0", + "larastan/larastan": "^3.9.6", + "laravel-zero/framework": "^12.1.0", + "mockery/mockery": "^1.6.12", + "nunomaduro/termwind": "^2.4.0", + "pestphp/pest": "^3.8.6", + "shipfastlabs/agent-detector": "^1.1.3" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "dev", + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2026-04-20T15:26:14+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.6.12", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "^2.0.1", + "lib-pcre": ">=7.0", + "php": ">=7.3" + }, + "conflict": { + "phpunit/phpunit": "<8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" + }, + "type": "library", + "autoload": { + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "https://github.com/padraic", + "role": "Author" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "support": { + "docs": "https://docs.mockery.io/", + "issues": "https://github.com/mockery/mockery/issues", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" + }, + "time": "2024-05-16T03:13:13+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.13.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2025-08-01T08:46:24+00:00" + }, + { + "name": "nunomaduro/collision", + "version": "v8.9.4", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "716af8f95a470e9094cfca09ed897b023be191a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/716af8f95a470e9094cfca09ed897b023be191a5", + "reference": "716af8f95a470e9094cfca09ed897b023be191a5", + "shasum": "" + }, + "require": { + "filp/whoops": "^2.18.4", + "nunomaduro/termwind": "^2.4.0", + "php": "^8.2.0", + "symfony/console": "^7.4.8 || ^8.0.8" + }, + "conflict": { + "laravel/framework": "<11.48.0 || >=14.0.0", + "phpunit/phpunit": "<11.5.50 || >=14.0.0" + }, + "require-dev": { + "brianium/paratest": "^7.8.5", + "larastan/larastan": "^3.9.6", + "laravel/framework": "^11.48.0 || ^12.56.0 || ^13.5.0", + "laravel/pint": "^1.29.1", + "orchestra/testbench-core": "^9.12.0 || ^10.12.1 || ^11.2.1", + "pestphp/pest": "^3.8.5 || ^4.4.3 || ^5.0.0", + "sebastian/environment": "^7.2.1 || ^8.0.4 || ^9.3.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + }, + "branch-alias": { + "dev-8.x": "8.x-dev" + } + }, + "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "dev", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2026-04-21T14:04:20+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "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", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "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.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "2.2.2", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5cc34d491a90e79c216d824f60fe21fd4d93bd6", + "reference": "e5cc34d491a90e79c216d824f60fe21fd4d93bd6", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ondřej Mirtes" + }, + { + "name": "Markus Staab" + }, + { + "name": "Vincent Langlet" + } + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2026-06-05T09:00:01+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "12.5.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "186dab580576598076de6818596d12b61801880e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/186dab580576598076de6818596d12b61801880e", + "reference": "186dab580576598076de6818596d12b61801880e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^5.7.0", + "php": ">=8.3", + "phpunit/php-text-template": "^5.0", + "sebastian/complexity": "^5.0", + "sebastian/environment": "^8.1.2", + "sebastian/lines-of-code": "^4.0.1", + "sebastian/version": "^6.0", + "theseer/tokenizer": "^2.0.1" + }, + "require-dev": { + "phpunit/phpunit": "^12.5.28" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "12.5.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "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/12.5.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" + } + ], + "time": "2026-06-01T13:24:19+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5", + "reference": "3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator", + "type": "tidelift" + } + ], + "time": "2026-02-02T14:04:18+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^12.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:58:58+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53", + "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:59:16+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "8.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "8.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/8.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:59:38+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "12.5.29", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "9aa66a47db3ea70f1a468e66dd969f67e594945a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9aa66a47db3ea70f1a468e66dd969f67e594945a", + "reference": "9aa66a47db3ea70f1a468e66dd969f67e594945a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.3", + "phpunit/php-code-coverage": "^12.5.7", + "phpunit/php-file-iterator": "^6.0.1", + "phpunit/php-invoker": "^6.0.0", + "phpunit/php-text-template": "^5.0.0", + "phpunit/php-timer": "^8.0.0", + "sebastian/cli-parser": "^4.2.1", + "sebastian/comparator": "^7.1.8", + "sebastian/diff": "^7.0.0", + "sebastian/environment": "^8.1.2", + "sebastian/exporter": "^7.0.3", + "sebastian/global-state": "^8.0.3", + "sebastian/object-enumerator": "^7.0.0", + "sebastian/recursion-context": "^7.0.1", + "sebastian/type": "^6.0.4", + "sebastian/version": "^6.0.0", + "staabm/side-effects-detector": "^1.0.5" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "12.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.29" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsoring.html", + "type": "other" + } + ], + "time": "2026-06-04T06:14:42+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "4.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "7d05781b13f7dec9043a629a21d086ed74582a15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7d05781b13f7dec9043a629a21d086ed74582a15", + "reference": "7d05781b13f7dec9043a629a21d086ed74582a15", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.5.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/cli-parser", + "type": "tidelift" + } + ], + "time": "2026-05-17T05:29:34+00:00" + }, + { + "name": "sebastian/comparator", + "version": "7.1.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "7c65c1e79836812819705b473a90c12399542485" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/7c65c1e79836812819705b473a90c12399542485", + "reference": "7c65c1e79836812819705b473a90c12399542485", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.3", + "sebastian/diff": "^7.0", + "sebastian/exporter": "^7.0.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.5.25" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/7.1.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" + } + ], + "time": "2026-05-21T04:45:25+00:00" + }, + { + "name": "sebastian/complexity", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb", + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:55:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "7.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7ab1ea946c012266ca32390913653d844ecd085f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", + "reference": "7ab1ea946c012266ca32390913653d844ecd085f", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0", + "symfony/process": "^7.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:55:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "8.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "9d32c685773823b1983e256ae4ecd48a10d6e439" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/9d32c685773823b1983e256ae4ecd48a10d6e439", + "reference": "9d32c685773823b1983e256ae4ecd48a10d6e439", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.5.26" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "8.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/8.1.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/environment", + "type": "tidelift" + } + ], + "time": "2026-05-25T13:40:20+00:00" + }, + { + "name": "sebastian/exporter", + "version": "7.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23", + "reference": "c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.3", + "sebastian/recursion-context": "^7.0.1" + }, + "require-dev": { + "phpunit/phpunit": "^12.5.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" + } + ], + "time": "2026-05-20T04:37:17+00:00" + }, + { + "name": "sebastian/global-state", + "version": "8.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "b164d3274d6537ab462591c5755f76a8f5b1aae9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b164d3274d6537ab462591c5755f76a8f5b1aae9", + "reference": "b164d3274d6537ab462591c5755f76a8f5b1aae9", + "shasum": "" + }, + "require": { + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0.1" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^12.5.28" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "8.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of 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/8.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" + } + ], + "time": "2026-06-01T15:10:33+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "d543b8ef219dcd8da262cbb958639a96bedba10e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d543b8ef219dcd8da262cbb958639a96bedba10e", + "reference": "d543b8ef219dcd8da262cbb958639a96bedba10e", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.7.0", + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.5.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/lines-of-code", + "type": "tidelift" + } + ], + "time": "2026-05-19T16:22:07+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "7.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "shasum": "" + }, + "require": { + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/7.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:57:48+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "4bfa827c969c98be1e527abd576533293c634f6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a", + "reference": "4bfa827c969c98be1e527abd576533293c634f6a", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:58:17+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "7.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", + "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/7.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" + } + ], + "time": "2025-08-13T04:44:59+00:00" + }, + { + "name": "sebastian/type", + "version": "6.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "82ff822c2edc46724be9f7411d3163021f602773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/82ff822c2edc46724be9f7411d3163021f602773", + "reference": "82ff822c2edc46724be9f7411d3163021f602773", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.5.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/6.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/type", + "type": "tidelift" + } + ], + "time": "2026-05-20T06:45:45+00:00" + }, + { + "name": "sebastian/version", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c", + "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T05:00:38+00:00" + }, + { + "name": "staabm/side-effects-detector", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4", + "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^8.1" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "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/2.0.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-12-08T11:19:18+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^8.3" + }, + "platform-dev": [], + "platform-overrides": { + "php": "8.3.23" + }, + "plugin-api-version": "2.6.0" +} diff --git a/config/app.php b/config/app.php new file mode 100644 index 0000000..423eed5 --- /dev/null +++ b/config/app.php @@ -0,0 +1,126 @@ + env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ + + 'debug' => (bool) env('APP_DEBUG', false), + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | the application so that it's available within Artisan commands. + | + */ + + 'url' => env('APP_URL', 'http://localhost'), + + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. The timezone + | is set to "UTC" by default as it is suitable for most use cases. + | + */ + + 'timezone' => 'UTC', + + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by Laravel's translation / localization methods. This option can be + | set to any locale for which you plan to have translation strings. + | + */ + + 'locale' => env('APP_LOCALE', 'en'), + + 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), + + 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is utilized by Laravel's encryption services and should be set + | to a random, 32 character string to ensure that all encrypted values + | are secure. You should do this prior to deploying the application. + | + */ + + 'cipher' => 'AES-256-CBC', + + 'key' => env('APP_KEY'), + + 'previous_keys' => [ + ...array_filter( + explode(',', (string) env('APP_PREVIOUS_KEYS', '')) + ), + ], + + /* + |-------------------------------------------------------------------------- + | Maintenance Mode Driver + |-------------------------------------------------------------------------- + | + | These configuration options determine the driver used to determine and + | manage Laravel's "maintenance mode" status. The "cache" driver will + | allow maintenance mode to be controlled across multiple machines. + | + | Supported drivers: "file", "cache" + | + */ + + 'maintenance' => [ + 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), + 'store' => env('APP_MAINTENANCE_STORE', 'database'), + ], + +]; diff --git a/config/auth.php b/config/auth.php new file mode 100644 index 0000000..d7568ff --- /dev/null +++ b/config/auth.php @@ -0,0 +1,117 @@ + [ + 'guard' => env('AUTH_GUARD', 'web'), + 'passwords' => env('AUTH_PASSWORD_BROKER', 'users'), + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | which utilizes session storage plus the Eloquent user provider. + | + | All authentication guards have a user provider, which defines how the + | users are actually retrieved out of your database or other storage + | system used by the application. Typically, Eloquent is utilized. + | + | Supported: "session" + | + */ + + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + ], + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication guards have a user provider, which defines how the + | users are actually retrieved out of your database or other storage + | system used by the application. Typically, Eloquent is utilized. + | + | If you have multiple user tables or models you may configure multiple + | providers to represent the model / table. These providers may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ + + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => env('AUTH_MODEL', User::class), + ], + + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | These configuration options specify the behavior of Laravel's password + | reset functionality, including the table utilized for token storage + | and the user provider that is invoked to actually retrieve users. + | + | The expiry time is the number of minutes that each reset token will be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + | The throttle setting is the number of seconds a user must wait before + | generating more password reset tokens. This prevents the user from + | quickly generating a very large amount of password reset tokens. + | + */ + + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'), + 'expire' => 60, + 'throttle' => 60, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the number of seconds before a password confirmation + | window expires and users are asked to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800), + +]; diff --git a/config/cache.php b/config/cache.php new file mode 100644 index 0000000..d7eec61 --- /dev/null +++ b/config/cache.php @@ -0,0 +1,136 @@ + env('CACHE_STORE', 'database'), + + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + | Supported drivers: "array", "database", "file", "memcached", + | "redis", "dynamodb", "storage", "octane", + | "session", "failover", "null" + | + */ + + 'stores' => [ + + 'array' => [ + 'driver' => 'array', + 'serialize' => false, + ], + + 'database' => [ + 'driver' => 'database', + 'connection' => env('DB_CACHE_CONNECTION'), + 'table' => env('DB_CACHE_TABLE', 'cache'), + 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), + 'lock_table' => env('DB_CACHE_LOCK_TABLE'), + ], + + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + 'lock_path' => storage_path('framework/cache/data'), + ], + + 'storage' => [ + 'driver' => 'storage', + 'disk' => env('CACHE_STORAGE_DISK'), + 'path' => env('CACHE_STORAGE_PATH', 'framework/cache/data'), + ], + + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), + 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), + ], + + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), + ], + + 'octane' => [ + 'driver' => 'octane', + ], + + 'failover' => [ + 'driver' => 'failover', + 'stores' => [ + 'database', + 'array', + ], + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing the APC, database, memcached, Redis, and DynamoDB cache + | stores, there might be other applications using the same cache. For + | that reason, you may prefix every cache key to avoid collisions. + | + */ + + 'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-cache-'), + + /* + |-------------------------------------------------------------------------- + | Serializable Classes + |-------------------------------------------------------------------------- + | + | This value determines the classes that can be unserialized from cache + | storage. By default, no PHP classes will be unserialized from your + | cache to prevent gadget chain attacks if your APP_KEY is leaked. + | + */ + + 'serializable_classes' => false, + +]; diff --git a/config/database.php b/config/database.php new file mode 100644 index 0000000..abbb88e --- /dev/null +++ b/config/database.php @@ -0,0 +1,184 @@ + env('DB_CONNECTION', 'sqlite'), + + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Below are all of the database connections defined for your application. + | An example configuration is provided for each database system which + | is supported by Laravel. You're free to add / remove connections. + | + */ + + 'connections' => [ + + 'sqlite' => [ + 'driver' => 'sqlite', + 'url' => env('DB_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', + 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), + 'busy_timeout' => null, + 'journal_mode' => null, + 'synchronous' => null, + 'transaction_mode' => 'DEFERRED', + ], + + 'mysql' => [ + 'driver' => 'mysql', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'mariadb' => [ + 'driver' => 'mariadb', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => env('DB_CHARSET', 'utf8'), + 'prefix' => '', + 'prefix_indexes' => true, + 'search_path' => 'public', + 'sslmode' => env('DB_SSLMODE', 'prefer'), + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => env('DB_CHARSET', 'utf8'), + 'prefix' => '', + 'prefix_indexes' => true, + // 'encrypt' => env('DB_ENCRYPT', 'yes'), + // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run on the database. + | + */ + + 'migrations' => [ + 'table' => 'migrations', + 'update_date_on_publish' => true, + ], + + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer body of commands than a typical key-value system + | such as Memcached. You may define your connection settings here. + | + */ + + 'redis' => [ + + 'client' => env('REDIS_CLIENT', 'phpredis'), + + 'options' => [ + 'cluster' => env('REDIS_CLUSTER', 'redis'), + 'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-database-'), + 'persistent' => env('REDIS_PERSISTENT', false), + ], + + 'default' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_DB', '0'), + 'max_retries' => env('REDIS_MAX_RETRIES', 3), + 'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'), + 'backoff_base' => env('REDIS_BACKOFF_BASE', 100), + 'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000), + ], + + 'cache' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_CACHE_DB', '1'), + 'max_retries' => env('REDIS_MAX_RETRIES', 3), + 'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'), + 'backoff_base' => env('REDIS_BACKOFF_BASE', 100), + 'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000), + ], + + ], + +]; diff --git a/config/filesystems.php b/config/filesystems.php new file mode 100644 index 0000000..37d8fca --- /dev/null +++ b/config/filesystems.php @@ -0,0 +1,80 @@ + env('FILESYSTEM_DISK', 'local'), + + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Below you may configure as many filesystem disks as necessary, and you + | may even configure multiple disks for the same driver. Examples for + | most supported storage drivers are configured here for reference. + | + | Supported drivers: "local", "ftp", "sftp", "s3" + | + */ + + 'disks' => [ + + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app/private'), + 'serve' => true, + 'throw' => false, + 'report' => false, + ], + + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/storage', + 'visibility' => 'public', + 'throw' => false, + 'report' => false, + ], + + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), + 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), + 'throw' => false, + 'report' => false, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ + + 'links' => [ + public_path('storage') => storage_path('app/public'), + ], + +]; diff --git a/config/logging.php b/config/logging.php new file mode 100644 index 0000000..b09cb25 --- /dev/null +++ b/config/logging.php @@ -0,0 +1,132 @@ + env('LOG_CHANNEL', 'stack'), + + /* + |-------------------------------------------------------------------------- + | Deprecations Log Channel + |-------------------------------------------------------------------------- + | + | This option controls the log channel that should be used to log warnings + | regarding deprecated PHP and library features. This allows you to get + | your application ready for upcoming major versions of dependencies. + | + */ + + 'deprecations' => [ + 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'trace' => env('LOG_DEPRECATIONS_TRACE', false), + ], + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Laravel + | utilizes the Monolog PHP logging library, which includes a variety + | of powerful log handlers and formatters that you're free to use. + | + | Available drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", "custom", "stack" + | + */ + + 'channels' => [ + + 'stack' => [ + 'driver' => 'stack', + 'channels' => explode(',', (string) env('LOG_STACK', 'single')), + 'ignore_exceptions' => false, + ], + + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, + ], + + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'days' => env('LOG_DAILY_DAYS', 14), + 'replace_placeholders' => true, + ], + + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => env('LOG_SLACK_USERNAME', env('APP_NAME', 'Laravel')), + 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'), + 'level' => env('LOG_LEVEL', 'critical'), + 'replace_placeholders' => true, + ], + + 'papertrail' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), + 'handler_with' => [ + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), + ], + 'processors' => [PsrLogMessageProcessor::class], + ], + + 'stderr' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => StreamHandler::class, + 'handler_with' => [ + 'stream' => 'php://stderr', + ], + 'formatter' => env('LOG_STDERR_FORMATTER'), + 'processors' => [PsrLogMessageProcessor::class], + ], + + 'syslog' => [ + 'driver' => 'syslog', + 'level' => env('LOG_LEVEL', 'debug'), + 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER), + 'replace_placeholders' => true, + ], + + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, + ], + + 'null' => [ + 'driver' => 'monolog', + 'handler' => NullHandler::class, + ], + + 'emergency' => [ + 'path' => storage_path('logs/laravel.log'), + ], + + ], + +]; diff --git a/config/mail.php b/config/mail.php new file mode 100644 index 0000000..e32e88d --- /dev/null +++ b/config/mail.php @@ -0,0 +1,118 @@ + env('MAIL_MAILER', 'log'), + + /* + |-------------------------------------------------------------------------- + | Mailer Configurations + |-------------------------------------------------------------------------- + | + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. + | + | Laravel supports a variety of mail "transport" drivers that can be used + | when delivering an email. You may specify which one you're using for + | your mailers below. You may also add additional mailers if needed. + | + | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", + | "postmark", "resend", "log", "array", + | "failover", "roundrobin" + | + */ + + 'mailers' => [ + + 'smtp' => [ + 'transport' => 'smtp', + 'scheme' => env('MAIL_SCHEME'), + 'url' => env('MAIL_URL'), + 'host' => env('MAIL_HOST', '127.0.0.1'), + 'port' => env('MAIL_PORT', 2525), + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + 'timeout' => null, + 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)), + ], + + 'ses' => [ + 'transport' => 'ses', + ], + + 'postmark' => [ + 'transport' => 'postmark', + // 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'), + // 'client' => [ + // 'timeout' => 5, + // ], + ], + + 'resend' => [ + 'transport' => 'resend', + ], + + 'sendmail' => [ + 'transport' => 'sendmail', + 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), + ], + + 'log' => [ + 'transport' => 'log', + 'channel' => env('MAIL_LOG_CHANNEL'), + ], + + 'array' => [ + 'transport' => 'array', + ], + + 'failover' => [ + 'transport' => 'failover', + 'mailers' => [ + 'smtp', + 'log', + ], + 'retry_after' => 60, + ], + + 'roundrobin' => [ + 'transport' => 'roundrobin', + 'mailers' => [ + 'ses', + 'postmark', + ], + 'retry_after' => 60, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all emails sent by your application to be sent from + | the same address. Here you may specify a name and address that is + | used globally for all emails that are sent by your application. + | + */ + + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', env('APP_NAME', 'Laravel')), + ], + +]; diff --git a/config/queue.php b/config/queue.php new file mode 100644 index 0000000..79c2c0a --- /dev/null +++ b/config/queue.php @@ -0,0 +1,129 @@ + env('QUEUE_CONNECTION', 'database'), + + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection options for every queue backend + | used by your application. An example configuration is provided for + | each backend supported by Laravel. You're also free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", + | "deferred", "background", "failover", "null" + | + */ + + 'connections' => [ + + 'sync' => [ + 'driver' => 'sync', + ], + + 'database' => [ + 'driver' => 'database', + 'connection' => env('DB_QUEUE_CONNECTION'), + 'table' => env('DB_QUEUE_TABLE', 'jobs'), + 'queue' => env('DB_QUEUE', 'default'), + 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90), + 'after_commit' => false, + ], + + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'), + 'queue' => env('BEANSTALKD_QUEUE', 'default'), + 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90), + 'block_for' => 0, + 'after_commit' => false, + ], + + 'sqs' => [ + 'driver' => 'sqs', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'default'), + 'suffix' => env('SQS_SUFFIX'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'after_commit' => false, + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), + 'queue' => env('REDIS_QUEUE', 'default'), + 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90), + 'block_for' => null, + 'after_commit' => false, + ], + + 'deferred' => [ + 'driver' => 'deferred', + ], + + 'background' => [ + 'driver' => 'background', + ], + + 'failover' => [ + 'driver' => 'failover', + 'connections' => [ + 'database', + 'deferred', + ], + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Job Batching + |-------------------------------------------------------------------------- + | + | The following options configure the database and table that store job + | batching information. These options can be updated to any database + | connection and table which has been defined by your application. + | + */ + + 'batching' => [ + 'database' => env('DB_CONNECTION', 'sqlite'), + 'table' => 'job_batches', + ], + + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control how and where failed jobs are stored. Laravel ships with + | support for storing failed jobs in a simple file or in a database. + | + | Supported drivers: "database-uuids", "dynamodb", "file", "null" + | + */ + + 'failed' => [ + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), + 'database' => env('DB_CONNECTION', 'sqlite'), + 'table' => 'failed_jobs', + ], + +]; diff --git a/config/relais_sms.php b/config/relais_sms.php new file mode 100644 index 0000000..575f96a --- /dev/null +++ b/config/relais_sms.php @@ -0,0 +1,53 @@ + [ + 'default_country' => env('RELAIS_SMS_DEFAULT_COUNTRY', 'FR'), + 'mobile_phone_regex' => env('RELAIS_SMS_MOBILE_PHONE_REGEX', '/^\s*(?:(?:\(\s*\+33\s*\)|\+33|0033)\s*(?:\(0\)\s*)?|0)\s*[67](?:[\s.-]*\d{2}){4}\s*$/'), + 'max_sms_per_campaign' => (int) env('RELAIS_SMS_MAX_SMS_PER_CAMPAIGN', 100), + 'history_retention_years' => (int) env('RELAIS_SMS_HISTORY_RETENTION_YEARS', 3), + 'scheduled_sends_enabled' => filter_var(env('RELAIS_SMS_SCHEDULED_SENDS_ENABLED', true), FILTER_VALIDATE_BOOLEAN), + 'display_timezone' => env('RELAIS_SMS_TIMEZONE', 'Europe/Paris'), + 'active_sms_provider' => env('RELAIS_SMS_ACTIVE_SMS_PROVIDER', 'ovh'), + 'galette_sync_enabled' => filter_var(env('RELAIS_SMS_GALETTE_SYNC_ENABLED', false), FILTER_VALIDATE_BOOLEAN), + 'carddav_sync_enabled' => filter_var(env('RELAIS_SMS_CARDDAV_SYNC_ENABLED', false), FILTER_VALIDATE_BOOLEAN), + 'caldav_calendar_sync_enabled' => filter_var(env('RELAIS_SMS_CALDAV_CALENDAR_SYNC_ENABLED', false), FILTER_VALIDATE_BOOLEAN), + 'sms_message_header' => env('RELAIS_SMS_MESSAGE_HEADER', ''), + 'sms_message_footer' => env('RELAIS_SMS_MESSAGE_FOOTER', ''), + ], + 'carddav' => [ + 'url' => env('RELAIS_SMS_CARDDAV_URL'), + 'username' => env('RELAIS_SMS_CARDDAV_USERNAME'), + 'password' => env('RELAIS_SMS_CARDDAV_PASSWORD'), + 'timeout' => (float) env('RELAIS_SMS_CARDDAV_TIMEOUT', 20), + ], + 'caldav' => [ + 'url' => env('RELAIS_SMS_CALDAV_CALENDAR_URL'), + 'username' => env('RELAIS_SMS_CALDAV_CALENDAR_USERNAME'), + 'password' => env('RELAIS_SMS_CALDAV_CALENDAR_PASSWORD'), + 'timeout' => (float) env('RELAIS_SMS_CALDAV_CALENDAR_TIMEOUT', 20), + 'lookahead_days' => (int) env('RELAIS_SMS_CALDAV_CALENDAR_LOOKAHEAD_DAYS', 90), + 'sync_interval_minutes' => (int) env('RELAIS_SMS_CALDAV_SYNC_INTERVAL_MINUTES', 60), + 'default_contact_ids' => array_values(array_filter(array_map('intval', explode(',', (string) env('RELAIS_SMS_CALDAV_DEFAULT_CONTACT_IDS', ''))))), + 'default_group_ids' => array_values(array_filter(array_map('intval', explode(',', (string) env('RELAIS_SMS_CALDAV_DEFAULT_GROUP_IDS', ''))))), + 'reminder_user_id' => env('RELAIS_SMS_CALDAV_REMINDER_USER_ID'), + 'reminder_message_header' => env('RELAIS_SMS_CALDAV_REMINDER_HEADER', ''), + 'reminder_message_footer' => env('RELAIS_SMS_CALDAV_REMINDER_FOOTER', ''), + 'reminder_description_max_length' => (int) env('RELAIS_SMS_CALDAV_DESCRIPTION_MAX_LENGTH', 120), + 'display_timezone' => env('RELAIS_SMS_CALDAV_TIMEZONE', 'Europe/Paris'), + ], + 'ovh' => [ + 'endpoint' => env('OVH_ENDPOINT', 'ovh-eu'), + 'application_key' => env('OVH_APPLICATION_KEY'), + 'application_secret' => env('OVH_APPLICATION_SECRET'), + 'consumer_key' => env('OVH_CONSUMER_KEY'), + 'sms_service_name' => env('OVH_SMS_SERVICE_NAME'), + 'sms_sender' => env('OVH_SMS_SENDER'), + 'sms_short_code' => filter_var(env('OVH_SMS_SHORT_CODE', trim((string) env('OVH_SMS_SENDER', '')) === '' && filter_var(env('OVH_SMS_SENDER_FOR_RESPONSE', true), FILTER_VALIDATE_BOOLEAN)), FILTER_VALIDATE_BOOLEAN), + 'sms_sender_for_response' => filter_var(env('OVH_SMS_SENDER_FOR_RESPONSE', true), FILTER_VALIDATE_BOOLEAN), + 'sms_no_stop_clause' => filter_var(env('OVH_SMS_NO_STOP_CLAUSE', true), FILTER_VALIDATE_BOOLEAN), + 'stop_callback_token' => env('OVH_SMS_STOP_CALLBACK_TOKEN'), + 'timeout' => (float) env('OVH_SMS_TIMEOUT', 20), + 'send_timeout' => (float) env('OVH_SMS_SEND_TIMEOUT', 60), + ], +]; diff --git a/config/services.php b/config/services.php new file mode 100644 index 0000000..6a90eb8 --- /dev/null +++ b/config/services.php @@ -0,0 +1,38 @@ + [ + 'key' => env('POSTMARK_API_KEY'), + ], + + 'resend' => [ + 'key' => env('RESEND_API_KEY'), + ], + + 'ses' => [ + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + ], + + 'slack' => [ + 'notifications' => [ + 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'), + 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'), + ], + ], + +]; diff --git a/config/session.php b/config/session.php new file mode 100644 index 0000000..f574482 --- /dev/null +++ b/config/session.php @@ -0,0 +1,233 @@ + env('SESSION_DRIVER', 'database'), + + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to expire immediately when the browser is closed then you may + | indicate that via the expire_on_close configuration option. + | + */ + + 'lifetime' => (int) env('SESSION_LIFETIME', 120), + + 'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false), + + /* + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it's stored. All encryption is performed + | automatically by Laravel and you may use the session like normal. + | + */ + + 'encrypt' => env('SESSION_ENCRYPT', false), + + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When utilizing the "file" session driver, the session files are placed + | on disk. The default storage location is defined here; however, you + | are free to provide another location where they should be stored. + | + */ + + 'files' => storage_path('framework/sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ + + 'connection' => env('SESSION_CONNECTION'), + + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table to + | be used to store sessions. Of course, a sensible default is defined + | for you; however, you're welcome to change this to another table. + | + */ + + 'table' => env('SESSION_TABLE', 'sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using one of the framework's cache driven session backends, you may + | define the cache store which should be used to store the session data + | between requests. This must match one of your defined cache stores. + | + | Affects: "dynamodb", "memcached", "redis" + | + */ + + 'store' => env('SESSION_STORE'), + + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ + + 'lottery' => [2, 100], + + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the session cookie that is created by + | the framework. Typically, you should not need to change this value + | since doing so does not grant a meaningful security improvement. + | + */ + + 'cookie' => env( + 'SESSION_COOKIE', + Str::slug((string) env('APP_NAME', 'laravel')).'-session' + ), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application, but you're free to change this when necessary. + | + */ + + 'path' => env('SESSION_PATH', '/'), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | This value determines the domain and subdomains the session cookie is + | available to. By default, the cookie will be available to the root + | domain without subdomains. Typically, this shouldn't be changed. + | + */ + + 'domain' => env('SESSION_DOMAIN'), + + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you when it can't be done securely. + | + */ + + 'secure' => env('SESSION_SECURE_COOKIE'), + + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. It's unlikely you should disable this option. + | + */ + + 'http_only' => env('SESSION_HTTP_ONLY', true), + + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | will set this value to "lax" to permit secure cross-site requests. + | + | See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value + | + | Supported: "lax", "strict", "none", null + | + */ + + 'same_site' => env('SESSION_SAME_SITE', 'lax'), + + /* + |-------------------------------------------------------------------------- + | Partitioned Cookies + |-------------------------------------------------------------------------- + | + | Setting this value to true will tie the cookie to the top-level site for + | a cross-site context. Partitioned cookies are accepted by the browser + | when flagged "secure" and the Same-Site attribute is set to "none". + | + */ + + 'partitioned' => env('SESSION_PARTITIONED_COOKIE', false), + + /* + |-------------------------------------------------------------------------- + | Session Serialization + |-------------------------------------------------------------------------- + | + | This value controls the serialization strategy for session data, which + | is JSON by default. Setting this to "php" allows the storage of PHP + | objects in the session but can make an application vulnerable to + | "gadget chain" serialization attacks if the APP_KEY is leaked. + | + | Supported: "json", "php" + | + */ + + 'serialization' => 'json', + +]; diff --git a/cron.php b/cron.php new file mode 100644 index 0000000..d149b43 --- /dev/null +++ b/cron.php @@ -0,0 +1,37 @@ +#!/usr/bin/env php + 'contacts:sync-carddav'], + ['command' => 'calendar:process-reminders', '--force-sync' => true], + ['command' => 'sms-campaigns:send-due'], + ['command' => 'sms-campaigns:reconcile'], + ['command' => 'sms-campaigns:prune-history'], +]; + +$status = 0; + +foreach ($commands as $command) { + $commandStatus = $app->handleCommand(new ArrayInput($command)); + + if ($commandStatus !== 0) { + $status = $commandStatus; + } +} + +exit($status); diff --git a/database/.gitignore b/database/.gitignore new file mode 100644 index 0000000..9b19b93 --- /dev/null +++ b/database/.gitignore @@ -0,0 +1 @@ +*.sqlite* diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php new file mode 100644 index 0000000..c4ceb07 --- /dev/null +++ b/database/factories/UserFactory.php @@ -0,0 +1,45 @@ + + */ +class UserFactory extends Factory +{ + /** + * The current password being used by the factory. + */ + protected static ?string $password; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => fake()->name(), + 'email' => fake()->unique()->safeEmail(), + 'email_verified_at' => now(), + 'password' => static::$password ??= Hash::make('password'), + 'remember_token' => Str::random(10), + ]; + } + + /** + * Indicate that the model's email address should be unverified. + */ + public function unverified(): static + { + return $this->state(fn (array $attributes) => [ + 'email_verified_at' => null, + ]); + } +} diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php new file mode 100644 index 0000000..05fb5d9 --- /dev/null +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -0,0 +1,49 @@ +id(); + $table->string('name'); + $table->string('email')->unique(); + $table->timestamp('email_verified_at')->nullable(); + $table->string('password'); + $table->rememberToken(); + $table->timestamps(); + }); + + Schema::create('password_reset_tokens', function (Blueprint $table) { + $table->string('email')->primary(); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + }); + + Schema::create('sessions', function (Blueprint $table) { + $table->string('id')->primary(); + $table->foreignId('user_id')->nullable()->index(); + $table->string('ip_address', 45)->nullable(); + $table->text('user_agent')->nullable(); + $table->longText('payload'); + $table->integer('last_activity')->index(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('users'); + Schema::dropIfExists('password_reset_tokens'); + Schema::dropIfExists('sessions'); + } +}; diff --git a/database/migrations/0001_01_01_000001_create_cache_table.php b/database/migrations/0001_01_01_000001_create_cache_table.php new file mode 100644 index 0000000..06dc7a5 --- /dev/null +++ b/database/migrations/0001_01_01_000001_create_cache_table.php @@ -0,0 +1,35 @@ +string('key')->primary(); + $table->mediumText('value'); + $table->bigInteger('expiration')->index(); + }); + + Schema::create('cache_locks', function (Blueprint $table) { + $table->string('key')->primary(); + $table->string('owner'); + $table->bigInteger('expiration')->index(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('cache'); + Schema::dropIfExists('cache_locks'); + } +}; diff --git a/database/migrations/0001_01_01_000002_create_jobs_table.php b/database/migrations/0001_01_01_000002_create_jobs_table.php new file mode 100644 index 0000000..edac6fe --- /dev/null +++ b/database/migrations/0001_01_01_000002_create_jobs_table.php @@ -0,0 +1,59 @@ +id(); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedSmallInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + + Schema::create('job_batches', function (Blueprint $table) { + $table->string('id')->primary(); + $table->string('name'); + $table->integer('total_jobs'); + $table->integer('pending_jobs'); + $table->integer('failed_jobs'); + $table->longText('failed_job_ids'); + $table->mediumText('options')->nullable(); + $table->integer('cancelled_at')->nullable(); + $table->integer('created_at'); + $table->integer('finished_at')->nullable(); + }); + + Schema::create('failed_jobs', function (Blueprint $table) { + $table->id(); + $table->string('uuid')->unique(); + $table->string('connection'); + $table->string('queue'); + $table->longText('payload'); + $table->longText('exception'); + $table->timestamp('failed_at')->useCurrent(); + + $table->index(['connection', 'queue', 'failed_at']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('jobs'); + Schema::dropIfExists('job_batches'); + Schema::dropIfExists('failed_jobs'); + } +}; diff --git a/database/migrations/2026_06_11_000000_create_app_settings_table.php b/database/migrations/2026_06_11_000000_create_app_settings_table.php new file mode 100644 index 0000000..e9ba56f --- /dev/null +++ b/database/migrations/2026_06_11_000000_create_app_settings_table.php @@ -0,0 +1,24 @@ +id(); + $table->string('key')->unique(); + $table->text('value')->nullable(); + $table->string('type')->default('string'); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('app_settings'); + } +}; diff --git a/database/migrations/2026_06_11_010000_create_contacts_table.php b/database/migrations/2026_06_11_010000_create_contacts_table.php new file mode 100644 index 0000000..0d11d6c --- /dev/null +++ b/database/migrations/2026_06_11_010000_create_contacts_table.php @@ -0,0 +1,35 @@ +id(); + $table->string('source')->default('local')->index(); + $table->string('external_id')->nullable(); + $table->string('first_name')->nullable(); + $table->string('last_name'); + $table->string('organization')->nullable(); + $table->string('email')->nullable(); + $table->text('notes')->nullable(); + $table->boolean('sms_opt_out')->default(false)->index(); + $table->boolean('is_favorite')->default(false)->index(); + $table->timestamp('synced_at')->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['source', 'external_id']); + $table->index(['last_name', 'first_name']); + }); + } + + public function down(): void + { + Schema::dropIfExists('contacts'); + } +}; diff --git a/database/migrations/2026_06_11_010100_create_contact_groups_table.php b/database/migrations/2026_06_11_010100_create_contact_groups_table.php new file mode 100644 index 0000000..c01e29f --- /dev/null +++ b/database/migrations/2026_06_11_010100_create_contact_groups_table.php @@ -0,0 +1,31 @@ +id(); + $table->string('source')->default('local')->index(); + $table->string('external_id')->nullable(); + $table->string('name'); + $table->string('slug')->unique(); + $table->text('description')->nullable(); + $table->boolean('is_favorite')->default(false)->index(); + $table->timestamp('synced_at')->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['source', 'external_id']); + }); + } + + public function down(): void + { + Schema::dropIfExists('contact_groups'); + } +}; diff --git a/database/migrations/2026_06_11_010200_create_contact_phone_numbers_table.php b/database/migrations/2026_06_11_010200_create_contact_phone_numbers_table.php new file mode 100644 index 0000000..d9ab6eb --- /dev/null +++ b/database/migrations/2026_06_11_010200_create_contact_phone_numbers_table.php @@ -0,0 +1,32 @@ +id(); + $table->foreignId('contact_id')->constrained()->cascadeOnDelete(); + $table->string('label')->nullable(); + $table->string('raw_number'); + $table->string('normalized_number')->nullable()->index(); + $table->string('country', 2)->nullable(); + $table->boolean('is_valid')->default(false)->index(); + $table->boolean('is_mobile')->default(false)->index(); + $table->boolean('is_primary')->default(false); + $table->string('validation_error')->nullable(); + $table->timestamps(); + + $table->index(['contact_id', 'is_primary']); + }); + } + + public function down(): void + { + Schema::dropIfExists('contact_phone_numbers'); + } +}; diff --git a/database/migrations/2026_06_11_010300_create_contact_contact_group_table.php b/database/migrations/2026_06_11_010300_create_contact_contact_group_table.php new file mode 100644 index 0000000..6ca88c0 --- /dev/null +++ b/database/migrations/2026_06_11_010300_create_contact_contact_group_table.php @@ -0,0 +1,24 @@ +foreignId('contact_id')->constrained()->cascadeOnDelete(); + $table->foreignId('contact_group_id')->constrained()->cascadeOnDelete(); + $table->timestamps(); + + $table->primary(['contact_id', 'contact_group_id']); + }); + } + + public function down(): void + { + Schema::dropIfExists('contact_contact_group'); + } +}; diff --git a/database/migrations/2026_06_11_020000_add_carddav_fields_to_contacts_table.php b/database/migrations/2026_06_11_020000_add_carddav_fields_to_contacts_table.php new file mode 100644 index 0000000..10d5d9b --- /dev/null +++ b/database/migrations/2026_06_11_020000_add_carddav_fields_to_contacts_table.php @@ -0,0 +1,23 @@ +string('remote_url')->nullable()->after('external_id'); + $table->string('remote_etag')->nullable()->after('remote_url'); + }); + } + + public function down(): void + { + Schema::table('contacts', function (Blueprint $table) { + $table->dropColumn(['remote_url', 'remote_etag']); + }); + } +}; diff --git a/database/migrations/2026_06_11_020100_create_source_sync_runs_table.php b/database/migrations/2026_06_11_020100_create_source_sync_runs_table.php new file mode 100644 index 0000000..06cfcb2 --- /dev/null +++ b/database/migrations/2026_06_11_020100_create_source_sync_runs_table.php @@ -0,0 +1,30 @@ +id(); + $table->string('source')->index(); + $table->string('status')->index(); + $table->timestamp('started_at')->nullable(); + $table->timestamp('finished_at')->nullable(); + $table->unsignedInteger('fetched_contacts')->default(0); + $table->unsignedInteger('synced_contacts')->default(0); + $table->unsignedInteger('deleted_contacts')->default(0); + $table->text('message')->nullable(); + $table->text('error')->nullable(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('source_sync_runs'); + } +}; diff --git a/database/migrations/2026_06_11_050000_create_sms_campaigns_table.php b/database/migrations/2026_06_11_050000_create_sms_campaigns_table.php new file mode 100644 index 0000000..ae315bf --- /dev/null +++ b/database/migrations/2026_06_11_050000_create_sms_campaigns_table.php @@ -0,0 +1,37 @@ +id(); + $table->foreignId('user_id')->nullable()->constrained()->nullOnDelete(); + $table->string('provider')->default('ovh')->index(); + $table->string('status')->default('draft')->index(); + $table->text('message'); + $table->unsignedInteger('recipients_count')->default(0); + $table->unsignedInteger('sent_count')->default(0); + $table->unsignedInteger('failed_count')->default(0); + $table->string('provider_service_name')->nullable(); + $table->string('provider_tag')->nullable()->index(); + $table->string('provider_job_id')->nullable(); + $table->json('request_payload')->nullable(); + $table->json('response_payload')->nullable(); + $table->text('error_message')->nullable(); + $table->timestamp('sent_at')->nullable(); + $table->timestamps(); + + $table->index(['created_at', 'status']); + }); + } + + public function down(): void + { + Schema::dropIfExists('sms_campaigns'); + } +}; diff --git a/database/migrations/2026_06_11_050100_create_sms_deliveries_table.php b/database/migrations/2026_06_11_050100_create_sms_deliveries_table.php new file mode 100644 index 0000000..3e934aa --- /dev/null +++ b/database/migrations/2026_06_11_050100_create_sms_deliveries_table.php @@ -0,0 +1,33 @@ +id(); + $table->foreignId('sms_campaign_id')->constrained()->cascadeOnDelete(); + $table->foreignId('contact_id')->nullable()->constrained()->nullOnDelete(); + $table->foreignId('contact_phone_number_id')->nullable()->constrained()->nullOnDelete(); + $table->string('contact_name'); + $table->string('number')->index(); + $table->string('status')->default('queued')->index(); + $table->string('provider_message_id')->nullable(); + $table->json('provider_response')->nullable(); + $table->text('error_message')->nullable(); + $table->timestamp('sent_at')->nullable(); + $table->timestamps(); + + $table->index(['sms_campaign_id', 'status']); + }); + } + + public function down(): void + { + Schema::dropIfExists('sms_deliveries'); + } +}; diff --git a/database/migrations/2026_06_11_060000_add_audit_selection_to_sms_campaigns_table.php b/database/migrations/2026_06_11_060000_add_audit_selection_to_sms_campaigns_table.php new file mode 100644 index 0000000..d86553e --- /dev/null +++ b/database/migrations/2026_06_11_060000_add_audit_selection_to_sms_campaigns_table.php @@ -0,0 +1,28 @@ +json('selected_contact_ids')->nullable()->after('recipients_count'); + $table->json('selected_group_ids')->nullable()->after('selected_contact_ids'); + $table->json('selected_group_names')->nullable()->after('selected_group_ids'); + }); + } + + public function down(): void + { + Schema::table('sms_campaigns', function (Blueprint $table) { + $table->dropColumn([ + 'selected_contact_ids', + 'selected_group_ids', + 'selected_group_names', + ]); + }); + } +}; diff --git a/database/migrations/2026_06_12_174505_create_calendar_events_table.php b/database/migrations/2026_06_12_174505_create_calendar_events_table.php new file mode 100644 index 0000000..0f92847 --- /dev/null +++ b/database/migrations/2026_06_12_174505_create_calendar_events_table.php @@ -0,0 +1,35 @@ +id(); + $table->string('source')->index(); + $table->string('external_id'); + $table->string('remote_url')->nullable(); + $table->string('remote_etag')->nullable(); + $table->string('summary')->nullable(); + $table->text('description')->nullable(); + $table->string('location')->nullable(); + $table->timestamp('starts_at')->nullable()->index(); + $table->timestamp('ends_at')->nullable(); + $table->json('attendees')->nullable(); + $table->timestamp('synced_at')->nullable(); + $table->timestamp('deleted_at')->nullable()->index(); + $table->timestamps(); + + $table->unique(['source', 'external_id']); + }); + } + + public function down(): void + { + Schema::dropIfExists('calendar_events'); + } +}; diff --git a/database/migrations/2026_06_12_174506_create_calendar_reminders_table.php b/database/migrations/2026_06_12_174506_create_calendar_reminders_table.php new file mode 100644 index 0000000..dd18e1b --- /dev/null +++ b/database/migrations/2026_06_12_174506_create_calendar_reminders_table.php @@ -0,0 +1,33 @@ +id(); + $table->foreignId('calendar_event_id')->constrained()->cascadeOnDelete(); + $table->foreignId('sms_campaign_id')->nullable()->constrained()->nullOnDelete(); + $table->string('reminder_key'); + $table->string('action')->default('DISPLAY')->index(); + $table->integer('trigger_minutes')->nullable(); + $table->timestamp('remind_at')->nullable()->index(); + $table->string('status')->default('pending')->index(); + $table->text('last_error')->nullable(); + $table->timestamp('sent_at')->nullable(); + $table->timestamps(); + + $table->unique(['calendar_event_id', 'reminder_key']); + $table->index(['status', 'remind_at']); + }); + } + + public function down(): void + { + Schema::dropIfExists('calendar_reminders'); + } +}; diff --git a/database/migrations/2026_06_12_200000_add_scheduling_to_sms_campaigns_table.php b/database/migrations/2026_06_12_200000_add_scheduling_to_sms_campaigns_table.php new file mode 100644 index 0000000..f6d451e --- /dev/null +++ b/database/migrations/2026_06_12_200000_add_scheduling_to_sms_campaigns_table.php @@ -0,0 +1,24 @@ +timestamp('scheduled_at')->nullable()->after('error_message')->index(); + $table->timestamp('canceled_at')->nullable()->after('sent_at'); + }); + } + + public function down(): void + { + Schema::table('sms_campaigns', function (Blueprint $table) { + $table->dropIndex(['scheduled_at']); + $table->dropColumn(['scheduled_at', 'canceled_at']); + }); + } +}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php new file mode 100644 index 0000000..14ddebf --- /dev/null +++ b/database/seeders/DatabaseSeeder.php @@ -0,0 +1,52 @@ +environment(['local', 'testing']) + && ! User::query()->where('email', $email)->exists() + && (trim($password) === '' || $password === 'relais-sms')) { + throw new RuntimeException('Definissez un mot de passe administrateur personnel dans RELAIS_SMS_ADMIN_PASSWORD avant de creer le compte hors developpement.'); + } + + $settings = collect(config('relais_sms.default_settings')) + ->map(fn (mixed $value, string $key): array => [ + 'key' => $key, + 'value' => is_bool($value) ? (string) (int) $value : (string) $value, + 'type' => match (true) { + is_bool($value) => 'boolean', + is_int($value) => 'integer', + default => 'string', + }, + ]) + ->values() + ->all(); + + AppSetting::upsert($settings, ['key'], ['value', 'type']); + + User::query()->firstOrCreate([ + 'email' => $email, + ], [ + 'name' => env('RELAIS_SMS_ADMIN_NAME', 'Administrateur RelaisSMS'), + 'password' => Hash::make($password), + ]); + } +} diff --git a/doc/afpma-sms-api.md b/doc/afpma-sms-api.md new file mode 100644 index 0000000..dde5056 --- /dev/null +++ b/doc/afpma-sms-api.md @@ -0,0 +1,37 @@ +# afpma-sms-api + +Il faut créer une interface weeb d’envoi de SMS à destination de personnes ou de groupes. + +Dans un premier temps, il faut définir les champs nécessaires et les sources de données possibles. Il peut y avoir plusieurs sources potentielles de contacts. + +La première source est Galette, le logiciel de gestion associative. À partir de la liste des adhérents, on récupère les informations de contact, notamment les numéros de téléphone. Un contact peut avoir plusieurs numéros de téléphone. + +Une seconde source possible, c’est des contacts carddav (carnet d’adresse nextcloud par exemple) + +On stockera un cache local dans une base de données. On récupérera également les groupes auxquels appartient l’adhérent. La notion de groupe est importante dans l’interface. + +C’est sync donc si un utilisateur est supprimer dans la source on le supprime en base + +Le sync ce fait via tâche cron mais aussi forcé via un bouton dans l'interface... + +On peut cumuler ces sources + +On peut ajouter des utilisateurs “locaux” (non distant, non sync…) donc en base sur chaque contact on doit se rappeler d’où ça vient…) + +Les groupes peuvent être importés depuis la source, rester présents dans l’interface, et ne pas forcément être supprimables. Ils peuvent aussi être créés à la volée par l’utilisateur. + +L’interface devra proposer un formulaire d’envoi de SMS. Ce formulaire devra permettre de choisir une destination, de saisir un texte, puis d’envoyer le SMS. + +La destination pourra être un ou plusieurs contacts, un ou plusieurs groupes, qu’il s’agisse de groupes locaux ou de groupes issus de Galette. + +Il faudra gérer le cas où un contact disparaît d’un groupe, ainsi que la mise à jour des informations importées. + +Une autre fonctionnalité envisagée est la connexion à un agenda. L’idée serait de pouvoir déclencher un envoi ou un rappel lié à un événement, par exemple une notification quelques minutes avant un événement. + +Il faudra conserver une trace des SMS envoyés par l’interface. + +Il peut aussi être utile de prévoir une gestion de groupes favoris ou de contacts favoris, afin de les faire remonter plus facilement dans les listes. + +Il s’agit d’une interface pour envoyer des SMS. L’envoi final ce fait via des API. Principalement ici compatible avec l’API OVH SMS dans un premier temps, mais il faudrait rester compatible avec d'autres... une sorte de gestion "plugin" / class... + +À partir de ces besoins exprimés, il faut réaliser une sorte de cahier des charges Markdown. \ No newline at end of file diff --git a/doc/cahier-des-charges-afpma-sms.md b/doc/cahier-des-charges-afpma-sms.md new file mode 100644 index 0000000..990c1dc --- /dev/null +++ b/doc/cahier-des-charges-afpma-sms.md @@ -0,0 +1,538 @@ +# Cahier des charges - RelaisSMS + +## 1. Objectif + +RelaisSMS est une application web d'envoi de SMS permettant à des utilisateurs autorisés de sélectionner des contacts ou des groupes issus de plusieurs sources, de composer un message, de l'envoyer immédiatement ou de le programmer, puis de consulter l'historique des envois. + +Le premier fournisseur cible est l'API SMS OVHcloud. L'architecture doit toutefois permettre d'ajouter d'autres fournisseurs sans réécrire l'interface ni la logique métier. + +## 2. Périmètre fonctionnel + +### 2.1 MVP + +- Authentification des utilisateurs de l'interface. +- Tableau de bord d'envoi de SMS. +- Sélection de destinataires par contacts et par groupes. +- Gestion de contacts locaux. +- Synchronisation de contacts CardDAV/Nextcloud. +- Préparation de l'intégration Galette, sans la mélanger avec CardDAV/Nextcloud. +- Cache local des contacts, téléphones, groupes et appartenances. +- Déclenchement de synchronisation par tâche planifiée et par bouton manuel. +- Suppression locale des contacts synchronisés disparus de la source. +- Journal des SMS envoyés. +- Connecteur SMS OVHcloud. +- Abstraction permettant d'ajouter d'autres connecteurs SMS. +- Gestion des favoris contacts et groupes. +- Gestion manuelle d'un refus SMS sur les contacts. +- Programmation d'un envoi différé dans le temps. + +### 2.2 V2 + +- Connexion à un agenda CalDAV ou autre source d'événements. +- Rappels SMS liés aux événements. +- Modèles de messages. +- Brouillons et réutilisation des derniers envois. +- Import/export CSV de contacts locaux. +- Statistiques détaillées par campagne, groupe, fournisseur et statut. +- Gestion fine des droits par rôle. + +## 3. Utilisateurs et rôles + +| Rôle | Droits principaux | +| --- | --- | +| Administrateur | Configurer les sources, fournisseurs SMS, utilisateurs, synchronisations et règles globales. | +| Opérateur | Envoyer des SMS, consulter contacts/groupes, lancer une synchronisation manuelle si autorisé. | + +## 4. Sources de données + +### 4.1 CardDAV/Nextcloud + +La source CardDAV permet de synchroniser un carnet d'adresses, par exemple Nextcloud. C'est un système d'import/synchronisation distinct de Galette, avec son propre connecteur, ses propres identifiants distants et son propre nommage de source. + +Données à récupérer : + +- UID vCard. +- Nom affiché. +- Nom, prénom si présents. +- Numéros de téléphone et types. +- Groupes/catégories vCard si présents. +- ETag ou horodatage distant pour optimiser la synchronisation. + +### 4.2 Galette + +La source Galette fournit des adhérents et leurs informations de contact. + +Galette n'est pas la source CardDAV/Nextcloud. Même si Galette peut exposer ou exporter des vCards, cette possibilité reste un détail d'implémentation du connecteur Galette et ne doit pas être nommée ni organisée comme une synchronisation CardDAV. + +Données à récupérer : + +- Identifiant distant stable. +- Nom, prénom, structure éventuelle. +- Numéros de téléphone, avec type si disponible. +- Adresse email si utile pour l'identification. +- Groupes ou statuts d'appartenance. +- Date de dernière modification si disponible. + +Mode d'accès retenu : + +- API HTTP Galette. + +Points à préciser au démarrage : + +- Endpoints exacts disponibles côté Galette. +- Mode d'authentification API. +- Mapping exact des champs téléphone. +- Mapping exact des groupes Galette vers les groupes applicatifs. + +### 4.3 Contacts locaux + +Les contacts locaux sont créés directement dans l'application. Ils ne sont jamais supprimés par une synchronisation distante. + +Chaque contact doit conserver : + +- Son origine : `local`, `galette`, `carddav`, puis identifiant de source. +- Son statut actif/inactif. +- Les numéros associés. +- Les groupes locaux auxquels il appartient. +- Ses informations de favori. +- Son indicateur de refus SMS, géré manuellement. + +## 5. Règles de synchronisation + +- Les sources sont cumulables. +- CardDAV/Nextcloud et Galette sont deux sources distinctes ; elles ne partagent ni connecteur, ni configuration, ni nommage fonctionnel. +- Un contact synchronisé est identifié par le couple clé de source (`carddav`, `galette`, etc.) + identifiant externe. +- Si un contact disparaît de la source distante, il est supprimé ou désactivé localement selon la politique choisie. +- Politique recommandée MVP : suppression logique (`deleted_at`) pour préserver l'historique SMS. +- Les groupes importés restent visibles dans l'interface. +- Les groupes importés ne sont pas supprimables manuellement, sauf suppression/désactivation de la source. +- Les groupes locaux sont créables, modifiables et supprimables depuis l'application. +- Si un contact disparaît d'un groupe distant, l'appartenance locale synchronisée est retirée. +- Les appartenances locales ne doivent pas être écrasées par les synchronisations distantes. +- Un bouton "Synchroniser" permet de lancer une synchronisation manuelle. +- Une tâche planifiée lance les synchronisations selon la fréquence configurée. + +## 6. Envoi SMS + +### 6.1 Formulaire + +Le formulaire d'envoi doit permettre : + +- La recherche de contacts. +- La recherche de groupes. +- L'ajout de plusieurs contacts et groupes. +- La déduplication automatique des numéros. +- La saisie du message. +- L'affichage du nombre de caractères. +- L'estimation du nombre de SMS selon encodage GSM-7/UCS-2. +- La prévisualisation du nombre de destinataires et numéros valides. +- La validation avant envoi. +- Le choix entre envoi immédiat et envoi programmé. +- Le respect d'une limite configurable de 100 SMS par envoi par défaut. + +### 6.2 Gestion des numéros + +- Normaliser les numéros au format E.164. +- Conserver le numéro original pour audit. +- Marquer les numéros invalides et les exclure de l'envoi. +- Gérer plusieurs numéros par contact. +- Envoyer à tous les numéros détectés comme téléphones portables. +- Détecter les téléphones portables avec une expression régulière configurable. +- Expression régulière par défaut à prévoir pour les numéros français de type `+33 6`, `+33 7`, `06`, `07`. +- Exclure les contacts marqués en refus SMS. +- Afficher un résumé des exclusions : numéros invalides, numéros non mobiles, doublons, contacts en refus SMS. + +### 6.3 Envoi différé + +L'utilisateur peut choisir une date et une heure d'envoi. L'envoi programmé reste modifiable ou annulable tant qu'il n'a pas été pris en charge par le job d'envoi. + +Règles attendues : + +- Stocker l'état `draft`, `scheduled`, `sending`, `sent`, `partial`, `failed`, `cancelled`. +- Refuser une programmation dans le passé. +- Déclencher les envois dus via scheduler Laravel lancé par cron. +- Résoudre les destinataires au moment de la validation de l'envoi, puis conserver cette liste pour audit. +- Option à confirmer en implémentation : revalider les refus SMS et numéros invalides juste avant l'envoi effectif. + +### 6.4 Journalisation + +Chaque envoi doit créer : + +- Une campagne ou opération d'envoi. +- Le message envoyé. +- L'utilisateur émetteur. +- Les destinataires résolus. +- Le fournisseur utilisé. +- Les statuts par numéro : préparé, envoyé, erreur, livré si disponible. +- La réponse brute ou référence externe du fournisseur. +- Les dates de création, envoi et dernière mise à jour. +- La date de programmation si l'envoi est différé. +- Une date d'expiration d'historique calculée selon la configuration, par défaut à 3 ans. + +## 7. Connecteurs SMS + +### 7.1 Interface technique + +Prévoir une interface applicative, par exemple : + +```php +interface SmsProviderInterface +{ + public function send(SmsMessage $message, array $recipients): SmsSendResult; + + public function getName(): string; + + public function supportsDeliveryStatus(): bool; +} +``` + +Le code métier dépend de cette interface et non d'OVHcloud directement. + +### 7.2 Connecteur OVHcloud + +Fonctions attendues : + +- Configuration des identifiants API. +- Sélection du service SMS OVHcloud. +- Envoi vers un ou plusieurs numéros. +- Récupération de l'identifiant de message distant. +- Gestion des erreurs API. +- Journalisation technique des réponses. + +Point d'attention : le SDK `ovh/ovh` existe, mais sa compatibilité PHP doit être validée avec la version cible du projet. Une implémentation via client HTTP standard peut être préférable si le SDK officiel n'est pas encore compatible avec la version PHP retenue. + +## 8. Agenda et rappels + +Fonction à prévoir mais hors MVP. + +Cas d'usage : + +- Synchroniser des événements depuis un agenda. +- Associer un événement à un groupe ou une liste de contacts. +- Déclencher un rappel X minutes/heures avant l'événement. +- Journaliser les rappels envoyés comme des SMS classiques. + +Règles à clarifier : + +- Source agenda : CalDAV, ICS, API spécifique. +- Responsabilité de la création des événements. +- Gestion des modifications et suppressions d'événements. +- Anti-doublon sur les rappels. + +## 9. Modèle de données cible + +Tables principales : + +- `users` +- `sources` +- `source_sync_runs` +- `contacts` +- `contact_phone_numbers` +- `groups` +- `contact_group_memberships` +- `favorites` +- `sms_providers` +- `sms_campaigns` +- `sms_recipients` +- `sms_delivery_events` +- `app_settings` +- `message_templates` en V2 +- `calendar_sources` en V2 +- `calendar_events` en V2 +- `scheduled_reminders` en V2 + +Champs clés recommandés : + +- `contacts.source` : `local`, `carddav`, `galette` ou autre clé de source explicite. +- `contacts.external_id` nullable, rempli pour les contacts synchronisés. +- `contacts.deleted_at` pour suppression logique. +- `groups.source` : `local`, `carddav`, `galette` ou autre clé de source explicite. +- `groups.external_id` nullable, rempli pour les groupes synchronisés. +- `contact_group_memberships.source` : `local`, `carddav`, `galette` ou autre clé de source explicite. +- `contact_phone_numbers.normalized_number`. +- `contacts.sms_opt_out` pour le refus SMS manuel. +- `sms_campaigns.status`. +- `sms_campaigns.scheduled_at` nullable. +- `sms_campaigns.expires_at`. +- `sms_recipients.provider_message_id`. + +## 10. Configuration applicative + +La configuration doit pouvoir être ajustée depuis l'interface administrateur ou, pour les secrets, via variables d'environnement. + +Paramètres attendus : + +- Identifiants et URL CardDAV/Nextcloud. +- Identifiants et URL Galette, à activer seulement au dernier lot. +- Identifiants et paramètres du fournisseur SMS OVHcloud. +- Fournisseur SMS actif. +- Expression régulière de détection des téléphones portables. +- Pays par défaut pour la normalisation des numéros. +- Limite maximale de SMS par envoi, valeur par défaut : 100. +- Durée de conservation de l'historique, valeur par défaut : 3 ans. +- Fréquence de synchronisation des sources. +- Activation ou non des envois programmés. + +Les secrets API ne doivent pas être stockés en clair dans une table applicative si l'environnement permet de les gérer par variables d'environnement ou coffre de secrets. + +## 11. Choix techniques recommandés + +### 11.1 Stack principale + +- PHP 8.3 ou 8.4. +- Laravel 13 si PHP 8.3 est disponible. +- Laravel 12 possible si l'environnement cible impose PHP 8.2. +- PostgreSQL ou MariaDB pour la base principale. +- Eloquent ORM + migrations Laravel. +- Queue Laravel avec driver `database`. +- Scheduler Laravel lancé par cron système. +- Blade pour les vues. +- Livewire ou Alpine.js en complément léger pour les recherches dynamiques et formulaires interactifs. +- Tailwind CSS ou CSS applicatif structuré pour l'interface. + +Pourquoi Laravel : + +- Suffisant pour le périmètre et moins lourd à mettre en place. +- Bons composants intégrés pour console, jobs, planification, validation, sécurité, migrations et HTTP. +- Interface Blade/Livewire adaptée à une application métier sans SPA complète. +- Architecture propre pour des connecteurs `SourceConnectorInterface` et `SmsProviderInterface`. +- Déploiement simple en PHP classique. +- Driver de queue en base adapté au volume attendu, sans service de queue additionnel. + +Alternative possible : + +- PHP natif structuré avec Composer peut suffire pour un très petit périmètre, mais Laravel apporte un socle utile pour auth, jobs, migrations et scheduler. + +### 11.2 Librairies pressenties + +| Besoin | Librairie / composant | +| --- | --- | +| Framework | `laravel/framework` | +| ORM et migrations | Eloquent + migrations Laravel | +| Authentification | Laravel Breeze ou auth applicative Laravel | +| Jobs asynchrones | Laravel Queue driver `database` | +| Planification | Laravel Scheduler + cron | +| HTTP API | Client HTTP Laravel ou `guzzlehttp/guzzle` | +| CardDAV/vCard | `sabre/dav`, `sabre/vobject` | +| Normalisation téléphone | `giggsey/libphonenumber-for-php` | +| SMS OVHcloud | Adapter maison via HTTP, ou `ovh/ovh` si compatible PHP cible | +| Tests | PHPUnit ou Pest | +| Qualité | PHPStan ou Larastan, Laravel Pint | +| Front | Blade, Livewire ou Alpine.js, Tailwind CSS ou CSS maintenu localement | + +## 12. Architecture applicative + +### 12.1 Domaines + +- `Contact` +- `Group` +- `Source` +- `Sync` +- `Sms` +- `Provider` +- `Audit` +- `Calendar` en V2 + +### 12.2 Interfaces métier + +```php +interface SourceConnectorInterface +{ + public function sync(SourceConfig $config): SyncResult; +} +``` + +```php +interface ContactResolverInterface +{ + public function resolve(RecipientSelection $selection): ResolvedRecipients; +} +``` + +```php +interface PhoneNumberNormalizerInterface +{ + public function normalize(string $rawNumber, string $defaultCountry): PhoneNumberResult; +} +``` + +## 13. Découpage en tâches + +### Lot 0 - Cadrage + +- Acter la séparation entre CardDAV/Nextcloud et Galette. +- Relever les inconnues Galette sans bloquer les premiers lots. +- Valider les paramètres d'accès CardDAV/Nextcloud. +- Valider le fournisseur OVHcloud, endpoints, credentials et quota. +- Définir les rôles utilisateurs. +- Définir la politique de suppression : logique ou physique. +- Valider la regex portable par défaut. +- Valider les paramètres de conservation et de limite d'envoi. + +Livrable : document de décisions techniques. + +### Lot 1 - Socle applicatif + +- Initialiser le projet Laravel. +- Configurer base, migrations, environnement et sécurité. +- Créer l'authentification. +- Mettre en place layout, navigation et design system minimal. +- Ajouter CI locale : tests, lint, analyse statique. + +Critère d'acceptation : un utilisateur connecté accède à l'interface vide. + +### Lot 2 - Modèle contacts/groupes + +- Créer entités et migrations. +- Gérer contacts locaux. +- Gérer groupes locaux. +- Gérer numéros multiples. +- Ajouter normalisation et validation téléphone. +- Ajouter flag manuel de refus SMS. +- Ajouter favoris. + +Critère d'acceptation : création d'un contact local, ajout à un groupe, recherche dans l'interface. + +### Lot 3 - Synchronisation CardDAV/Nextcloud + +- Implémenter `CardDavSourceConnector`. +- Lire les vCards et extraire téléphones/catégories. +- Utiliser ETag/UID si disponible. +- Gérer disparition distante. +- Écrire les logs de synchronisation. +- Gérer création, mise à jour et disparition. +- Ajouter déclenchement manuel. + +Critère d'acceptation : un carnet Nextcloud peut être synchronisé et ses contacts apparaissent dans l'interface. + +### Lot 4 - Sélection destinataires + +- Construire recherche contacts/groupes. +- Résoudre les groupes vers contacts. +- Dédupliquer les numéros. +- Appliquer la regex portable configurable. +- Exclure les contacts en refus SMS. +- Signaler invalides, non mobiles, doublons, refus SMS et contacts sans téléphone. +- Préparer un résumé avant envoi. + +Critère d'acceptation : sélectionner plusieurs groupes et contacts produit une liste de numéros uniques et valides. + +### Lot 5 - Envoi SMS + +- Créer `SmsProviderInterface`. +- Implémenter connecteur OVHcloud. +- Créer campagnes et destinataires. +- Envoyer via job Laravel Queue. +- Gérer erreurs et retries. +- Afficher l'état d'envoi. + +Critère d'acceptation : un SMS peut être envoyé via OVHcloud et apparaît dans l'historique. + +### Lot 6 - Historique et audit + +- Lister les campagnes. +- Filtrer par date, utilisateur, groupe, statut. +- Voir le détail par destinataire. +- Export CSV simple. +- Mettre en place l'expiration automatique à 3 ans, configurable. + +Critère d'acceptation : un administrateur peut retrouver qui a envoyé quoi, quand et à quels numéros. + +### Lot 7 - Envois programmés + +- Ajouter date/heure d'envoi au formulaire. +- Créer un statut `scheduled`. +- Déclencher les campagnes dues via Scheduler Laravel. +- Permettre l'annulation avant prise en charge. +- Journaliser le passage de `scheduled` à `sending`. + +Critère d'acceptation : un SMS peut être programmé, puis envoyé automatiquement à l'heure prévue. + +### Lot 8 - Agenda et rappels V2 + +- Configurer une source agenda. +- Synchroniser événements. +- Programmer des rappels. +- Empêcher les doublons. +- Journaliser comme campagne SMS. + +Critère d'acceptation : un événement peut générer un rappel SMS automatiquement. + +### Lot 9 - Synchronisation Galette + +- Revalider l'état de l'instance Galette après upgrade. +- Implémenter `GaletteSourceConnector`, séparé du connecteur CardDAV. +- Choisir le mécanisme d'accès Galette : API HTTP, export CSV authentifié ou autre mécanisme validé. +- Mapper adhérents, téléphones et groupes/statuts Galette. +- Gérer création, mise à jour et disparition. +- Ajouter déclenchement manuel et logs de synchronisation. + +Critère d'acceptation : une synchronisation Galette met à jour le cache local sans écraser les données locales ni réutiliser le nommage CardDAV/Nextcloud. + +## 14. Parcours interface + +### Écran principal - Envoi + +- Barre latérale : Envoi, Contacts, Groupes, Sources, Historique, Paramètres. +- Zone de sélection destinataires avec recherche rapide. +- Panneau contacts/groupes favoris. +- Zone message avec compteur. +- Résumé compact avant envoi : destinataires, numéros valides, invalides, non mobiles, refus SMS, nombre de SMS estimé. +- Choix envoi immédiat ou programmé. +- Bouton d'envoi avec confirmation. + +### Écran contacts + +- Liste filtrable. +- Badges d'origine. +- Téléphones associés. +- Groupes. +- Favori. +- Refus SMS. +- État synchronisé/local/supprimé. + +### Écran sources + +- Liste des sources. +- Dernière synchronisation. +- Statut. +- Bouton synchroniser. +- Détail des erreurs. + +### Écran historique + +- Liste des campagnes. +- Détail destinataires. +- Statuts d'envoi. +- Référence fournisseur. +- Export. + +## 15. Sécurité et conformité + +- Accès authentifié obligatoire. +- Protection CSRF sur formulaires. +- Journalisation des actions sensibles. +- Stockage chiffré ou protégé des secrets API. +- Masquage partiel des numéros dans certaines vues si nécessaire. +- Conservation de l'historique compatible avec les obligations internes. +- Expiration automatique de l'historique au bout de 3 ans par défaut, durée configurable. +- Prévoir une procédure de suppression/anonymisation sur demande. +- Sauvegarde régulière de la base. + +## 16. Décisions actées + +- CardDAV/Nextcloud et Galette sont deux systèmes d'import/synchronisation distincts. +- Galette est reporté au dernier lot, car l'instance cible n'est pas prête. +- Les SMS partent vers tous les numéros détectés comme portables. +- La détection portable est basée sur une regex configurable. +- Les contacts peuvent être marqués manuellement en refus SMS. +- Le volume maximal attendu par envoi est de 100 SMS. +- Il n'y a pas de validation à deux personnes avant envoi. +- L'interface affiche le nombre de SMS estimé, pas le coût. +- L'historique expire à 3 ans par défaut, avec durée configurable. + +## 17. Références techniques consultées + +- Laravel release notes : https://laravel.com/docs/releases +- SDK PHP OVHcloud : https://github.com/ovh/php-ovh +- SabreDAV : https://sabre.io/dav/ diff --git a/doc/lot-0-decisions-techniques.md b/doc/lot-0-decisions-techniques.md new file mode 100644 index 0000000..5f2fe93 --- /dev/null +++ b/doc/lot-0-decisions-techniques.md @@ -0,0 +1,236 @@ +# RelaisSMS - Lot 0 - Decisions techniques + +Date : 2026-06-11 + +## Objectif du lot + +Ce document fixe les decisions de cadrage avant le demarrage du socle applicatif. Il complete le cahier des charges et sert de reference pour les lots suivants. + +## Decisions actees + +| Sujet | Decision | Impact | +| --- | --- | --- | +| Source CardDAV/Nextcloud | CardDAV/Nextcloud est le premier systeme d'import/synchronisation distant a implementer. | Le lot 3 porte sur `CardDavSourceConnector` et ne depend pas de Galette. | +| Source Galette | Galette est prepare comme source future, mais le connecteur n'est pas implemente tant que l'instance n'est pas mise a jour. | Galette est reporte au dernier lot. Le socle et CardDAV/Nextcloud avancent sans dependance Galette. | +| Nommage des sources | CardDAV/Nextcloud et Galette sont deux sources separees, meme si Galette expose ou exporte un format vCard. | Les connecteurs, configurations, cles de source et libelles UI restent distincts. Pas de regroupement sous un meme lot ou nommage. | +| Version Galette cible | Galette 1.2.1 cote projet. La documentation `latest` consultee affiche 1.2.2. | Les endpoints exacts seront revalides apres upgrade, avant implementation du dernier lot Galette. | +| Fournisseur SMS | OVHcloud SMS via API REST OVH Europe. | Le connecteur initial depend de l'API OVH, isole derriere `SmsProviderInterface`. | +| SDK OVH | Ne pas imposer le SDK au lot 0. Preferer un adaptateur HTTP Laravel au demarrage, sauf validation explicite du SDK avec la version PHP cible. | Moins de dependance externe et controle clair de la signature API. | +| Roles | Un seul role applicatif au MVP : administrateur complet. | Pas de RBAC fin au lot 1. Tous les utilisateurs authentifies ont les memes droits. | +| Suppression contacts synchronises | Suppression logique par `deleted_at`, pas suppression physique. | L'historique SMS reste auditable meme si un contact disparait d'une source. | +| Suppression contacts locaux | Jamais supprimes par synchronisation. | Un contact local reste sous controle applicatif. | +| Refus SMS | Flag manuel `sms_opt_out` au niveau contact. | Les contacts opt-out sont exclus au moment de la resolution des destinataires. | +| Limite d'envoi | 100 SMS par envoi par defaut, configurable. | Validation cote serveur obligatoire avant creation de campagne. | +| Conservation historique | 3 ans par defaut, configurable. | `sms_campaigns.expires_at` est calcule a la creation. | +| Programmation | Prevue dans le modele, activee par configuration. | Le lot 7 pourra utiliser le scheduler sans revoir le modele. | + +## CardDAV/Nextcloud + +### Etat retenu + +CardDAV/Nextcloud est la source distante prioritaire pour l'import/synchronisation. Elle est traitee comme un systeme autonome : son connecteur lit des carnets CardDAV, des vCards, des UID et des ETags, sans reutiliser le contrat Galette. + +### Contrat cible pour RelaisSMS + +Le connecteur CardDAV devra fournir au cache local : + +| Donnee RelaisSMS | Source CardDAV attendue | +| --- | --- | +| Identifiant distant | UID vCard, complete par l'URL ou l'adresse du carnet si necessaire. | +| Nom affiche | `FN` vCard. | +| Nom / prenom | Champs structures vCard si presents. | +| Telephones | Proprietes `TEL`, avec conservation du type si disponible. | +| Groupes | Categories vCard si presentes. | +| Synchronisation incrementale | ETag, `ctag` ou horodatage distant selon les capacites du serveur. | + +Decision : nommer cette source `carddav` ou `carddav_nextcloud` cote configuration/UI, jamais `galette_vcard`. + +## Galette + +### Etat retenu + +Galette est laisse de cote pour l'implementation immediate, conformement au cadrage projet : l'upgrade est planifie mais pas encore effectif. Le lot 0 documente donc le contrat attendu sans figer un endpoint qui pourrait changer au moment de l'upgrade. Le connecteur Galette sera le dernier lot. + +### Documentation consultee + +- Documentation Galette fournie : +- La page consultee est une documentation Doxygen de classes PHP, pas une specification REST/OpenAPI. +- Elements reperes utiles au cadrage : + - `Galette\Controllers\Crud\MembersController::list` + - `Galette\Controllers\Crud\MembersController::ajaxList` + - `Galette\Controllers\Crud\MembersController::show` + - `Galette\Controllers\Crud\MembersController::vcard` + - `Galette\Controllers\CsvController::membersExport` + +### Contrat cible pour RelaisSMS + +Le connecteur Galette devra fournir au cache local : + +| Donnee RelaisSMS | Source Galette attendue | +| --- | --- | +| Identifiant distant | ID adherent Galette, par exemple `Numéro adhérent` dans l'export actuel. | +| Nom | Champ nom. | +| Prenom | Champ prenom. | +| Structure | Personne morale si presente. | +| Email | Courriel. | +| Telephones | Telephone et GSM, avec conservation du numero original. | +| Groupes/statuts | Statut adherent au minimum ; groupes Galette a confirmer apres upgrade. | +| Date de modification | Date de modification si exposee par API/export. | + +### Endpoints a valider apres upgrade + +Avant le lot 9, valider sur l'instance Galette 1.2.1 : + +| Usage | Endpoint ou mecanisme attendu | Statut | +| --- | --- | --- | +| Liste complete des adherents | Endpoint HTTP ou export membres base sur `membersExport` | A confirmer | +| Detail adherent | Route detail membre ou endpoint dedie | A confirmer | +| Fiche/export vCard Galette | Route `vcard` si exploitable dans le connecteur Galette | Optionnel, sans lien avec CardDAV/Nextcloud | +| Groupes/statuts | Route groupes ou champs presents dans la liste/export | A confirmer | +| Authentification | Session, jeton, basic auth ou autre mecanisme Galette | A confirmer | +| Filtrage incremental | Date de modification, ETag ou pagination | A confirmer | + +Decision : ne pas coupler RelaisSMS a une route Galette non confirmee. Le connecteur sera concu avec un adaptateur remplacable : API JSON si disponible, export CSV authentifie en solution de repli. Une eventuelle route vCard Galette reste un mecanisme interne au connecteur Galette, pas une source CardDAV. + +## OVHcloud SMS + +### Documentation consultee + +- Page produit API SMS OVHcloud : +- Definition API OVH SMS Europe : + +### Endpoints retenus pour le MVP + +Base API : `https://eu.api.ovh.com/1.0` + +| Usage | Methode | Endpoint | Notes | +| --- | --- | --- | --- | +| Lister les services SMS | `GET` | `/sms` | Permet de selectionner `serviceName`. | +| Lire le compte SMS | `GET` | `/sms/{serviceName}` | Retourne notamment statut et credits restants. | +| Estimer un message | `POST` | `/sms/estimate` | Parametres : `message`, `noStopClause`, `senderType`. | +| Envoyer un job SMS | `POST` | `/sms/{serviceName}/jobs` | Parametres principaux : `message`, `receivers`, `sender`, `noStopClause`, `tag`. | +| Lire jobs en attente | `GET` | `/sms/{serviceName}/jobs` | Utile pour debug et suivi. | +| Lire un job | `GET` | `/sms/{serviceName}/jobs/{id}` | Suivi fin si necessaire. | +| Annuler un job | `DELETE` | `/sms/{serviceName}/jobs/{id}` | A utiliser seulement tant que l'envoi est stoppable. | +| Historique sortant | `GET` | `/sms/{serviceName}/outgoing` | Filtres disponibles : dates, destinataire, sender, tag, etc. | +| Detail sortant | `GET` | `/sms/{serviceName}/outgoing/{id}` | Permet de recuperer les informations par SMS envoye. | +| Expediteurs autorises | `GET` | `/sms/{serviceName}/senders` | Pour valider la configuration sender. | + +Les endpoints batch existent aussi (`/sms/{serviceName}/batches`) et supportent les envois differes via `deferred`. Decision MVP : demarrer avec `/jobs` pour l'envoi immediat et gerer la programmation cote RelaisSMS via queue/scheduler. Les batches restent une option a reevaluer au lot 7 si l'on veut deleguer le differe a OVH. + +### Credentials attendus + +Configuration par variables d'environnement : + +```dotenv +OVH_ENDPOINT=ovh-eu +OVH_APPLICATION_KEY= +OVH_APPLICATION_SECRET= +OVH_CONSUMER_KEY= +OVH_SMS_SERVICE_NAME= +OVH_SMS_SENDER= +OVH_SMS_NO_STOP_CLAUSE=true +``` + +Les secrets ne sont pas stockes en clair en base. L'interface pourra afficher l'etat de configuration sans exposer les valeurs. + +### Quota et garde-fous + +- Le compte OVH expose `creditsLeft` via `GET /sms/{serviceName}`. +- RelaisSMS applique sa propre limite de 100 SMS par campagne par defaut. +- Avant envoi, le connecteur doit refuser une campagne si : + - aucun `serviceName` n'est configure ; + - aucun expediteur valide n'est configure quand necessaire ; + - la liste finale depasse la limite applicative ; + - OVH retourne des destinataires invalides. + +## Numeros de telephone + +### Echantillon Galette + +Fichier analyse : `doc/tmp/liste_adherents_filtree.csv` + +- 179 lignes adherents. +- 86 numeros presents dans `Telephone` ou `GSM`. +- Exemples fictifs de formats : `06 11 11 11 11`, `0622222222`, `(+33) 6 33 33 33 33`, `+33 (0)6 44 44 44 44`, fixes francais, numeros internationaux. + +### Regex portable par defaut + +La regex par defaut detecte les mobiles francais bruts avant normalisation : + +```regex +^\s*(?:(?:\(\s*\+33\s*\)|\+33|0033)\s*(?:\(0\)\s*)?|0)\s*[67](?:[\s.-]*\d{2}){4}\s*$ +``` + +Elle accepte notamment : + +- `06 11 11 11 11` +- `0622222222` +- `07 55 55 55 55` +- `(+33) 6 33 33 33 33` +- `+33 (0)6 44 44 44 44` +- `0033 6 11 11 11 11` + +Elle exclut les fixes francais (`01`, `02`, `03`, `04`, `05`, `09`) et les numeros mobiles non francais. Le pays par defaut est `FR`. + +Decision importante : cette regex sert a classifier les portables. La normalisation E.164 reste separee et devra etre faite avec `giggsey/libphonenumber-for-php` au lot 2. + +## Parametres applicatifs par defaut + +| Cle | Valeur par defaut | Source | +| --- | --- | --- | +| `default_country` | `FR` | Cadrage projet | +| `mobile_phone_regex` | Regex ci-dessus | Echantillon Galette | +| `max_sms_per_campaign` | `100` | Cahier des charges | +| `history_retention_years` | `3` | Cahier des charges | +| `scheduled_sends_enabled` | `true` | MVP | +| `active_sms_provider` | `ovh` | Fournisseur cible | +| `galette_sync_enabled` | `false` | Upgrade Galette non fait | +| `carddav_sync_enabled` | `false` | Active a partir du lot 3 | + +## Impacts pour les lots suivants + +### Lot 1 + +- Initialiser Laravel sans dependance Galette active. +- Authentification simple. +- Tous les utilisateurs authentifies sont administrateurs. +- Prevoir `app_settings` ou configuration equivalente pour les parametres non secrets. + +### Lot 2 + +- Stocker `raw_number`, `normalized_number`, `is_valid`, `is_mobile`. +- Utiliser la regex configurable pour `is_mobile`. +- Ajouter `sms_opt_out` sur les contacts. +- Prevoir `deleted_at` sur contacts synchronises. +- Prevoir des cles de source distinctes pour `local`, `carddav` et `galette`. + +### Lot 3 + +- Implementer `CardDavSourceConnector`. +- Synchroniser les vCards depuis Nextcloud/CardDAV avec UID et ETag si disponibles. +- Mapper les categories vCard en groupes importes CardDAV. + +### Lot 5 + +- Implementer `OvhSmsProvider` via client HTTP signe. +- Journaliser reponse OVH brute et IDs retournes. +- Utiliser le champ `tag` OVH pour relier les SMS a une campagne RelaisSMS. + +### Lot 9 + +- Revalider Galette 1.2.1 apres upgrade. +- Choisir entre API JSON, export CSV authentifie ou route Galette dediee. +- Mapper les statuts Galette en groupes applicatifs importes. +- Garder un nommage Galette explicite, separe de CardDAV/Nextcloud. + +## Points ouverts + +| Sujet | Question | A trancher avant | +| --- | --- | --- | +| Galette auth | Quel mecanisme d'authentification sera disponible apres upgrade ? | Lot 9 | +| Galette groupes | Les groupes sont-ils exposes directement ou seulement les statuts ? | Lot 9 | +| CardDAV categories | Les categories Nextcloud sont-elles renseignees et suffisantes comme groupes ? | Lot 3 | +| OVH sender | Expediteur alphanumerique valide ou numero reponse ? | Lot 5 | +| STOP OVH | `noStopClause=true` est-il conforme a l'usage AFPMA non publicitaire ? | Lot 5 | +| Numeros internationaux | Faut-il envoyer aux mobiles non francais presents dans les sources synchronisees ? | Lot 4 | diff --git a/doc/maquette-afpma-sms.html b/doc/maquette-afpma-sms.html new file mode 100644 index 0000000..7dba255 --- /dev/null +++ b/doc/maquette-afpma-sms.html @@ -0,0 +1,736 @@ + + + + + + Maquette RelaisSMS + + + +
+ + +
+
+
+

Nouvel envoi SMS

+

Connecté avec OVHcloud · 1 284 crédits disponibles

+
+
+ + + +
+
+ +
+
+
+
+

Composer

+
+ SMS + Modèle + Rappel +
+
+ +
+
+ + +
+ +
+
+ ★ Encadrants + 18 contacts · local +
+
+ ★ Adhérents actifs + 246 contacts · Galette +
+
+ ★ Urgence bureau + 7 contacts · mixte +
+
+ +
+ + +
+ 127 caractères · encodage GSM-7 + 1 SMS par destinataire +
+
+ +
+ +
+
+ Envoyer maintenant + Départ immédiat après confirmation. +
+
+ Programmer + Demain à 09:00 · modifiable avant envoi. +
+
+
+ +
+ 54 numéros valides + 1 SMS / destinataire + 3 sans portable + 2 refus SMS exclus + Limite 100 SMS +
+ +
+
! 5 destinataires exclus avant envoi
+ +
+
+
+ +
+
+

Derniers envois

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DateMessageDestinatairesStatut
Aujourd'hui 10:42Rappel atelier32Envoyé
Hier 18:07Changement de salle19Partiel
08/06 09:15Convocation CA112 erreurs
+
+
+ +
+
+
+ + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..baf258a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1232 @@ +{ + "name": "RelaisSMS", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "@tailwindcss/vite": "^4.0.0", + "laravel-vite-plugin": "^3.1", + "tailwindcss": "^4.0.0", + "vite": "^8.0.0" + } + }, + "node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", + "dev": true, + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz", + "integrity": "sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==", + "dev": true, + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.133.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.133.0.tgz", + "integrity": "sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.3.tgz", + "integrity": "sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.3.tgz", + "integrity": "sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.3.tgz", + "integrity": "sha512-9YpfeUvSE2RS7wysJ81uOZkXJz7f7Q55H2Gvp3VEw/EsahqDtrphrZ0EwDLK5vvKOzaCrBsjF8JmnMLcUt78Gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.3.tgz", + "integrity": "sha512-yB1IlAsSNHncV6SCTL27/MVGR5htvQsoGxIv5KMGXALp+Ll1wYsn+x98M9MW7qa+NdSbvrrY7ANI4wLJ0n1e6g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.3.tgz", + "integrity": "sha512-Yi30IVAAfLUCy2MseFjbB1jAMDl1VMCAas5StnYp8da9+CKvMd2H2cbEjWcw5NPaPqzvYkVIaF1nNUG+b7u/sw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.3.tgz", + "integrity": "sha512-jsO7R8To+AdlYgUmN5sHSCZbfhtMBkO0WUx8iORQnPcMMdgr7qM2DQmMwgabs3GhNztdmoKkMKQFHD6DTMCIQw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.3.tgz", + "integrity": "sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.3.tgz", + "integrity": "sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.3.tgz", + "integrity": "sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.3.tgz", + "integrity": "sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.3.tgz", + "integrity": "sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.3.tgz", + "integrity": "sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.3.tgz", + "integrity": "sha512-JTtb8BWFynicNSoPrehsCzBtOKjZ6jhMiPFEmOiuXg1Fl8dn2KHQob+GuPSGR0dryQa1PQJbzjF3dqO/whhjLg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "optional": true, + "dependencies": { + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.3.tgz", + "integrity": "sha512-gEdFFEN70A/jxb2svrWsN3aDL7OUtmvlOy+6fa2jxG8K0wQ1ZbdeLGnidov6Yu5/733dI5ySfzFlQ/cb0bSz1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.3.tgz", + "integrity": "sha512-eXB7CHuaQdqmJcc3koCNtNPmT/bj2gc999kUFgBxG8Ac0NdgXc4rkCHhqrgrhN3zddvvvrgzj1e90SuSfmyIXA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true + }, + "node_modules/@tailwindcss/node": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.0.tgz", + "integrity": "sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g==", + "dev": true, + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.21.0", + "jiti": "^2.6.1", + "lightningcss": "1.32.0", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.3.0" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.0.tgz", + "integrity": "sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg==", + "dev": true, + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.3.0", + "@tailwindcss/oxide-darwin-arm64": "4.3.0", + "@tailwindcss/oxide-darwin-x64": "4.3.0", + "@tailwindcss/oxide-freebsd-x64": "4.3.0", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.0", + "@tailwindcss/oxide-linux-arm64-gnu": "4.3.0", + "@tailwindcss/oxide-linux-arm64-musl": "4.3.0", + "@tailwindcss/oxide-linux-x64-gnu": "4.3.0", + "@tailwindcss/oxide-linux-x64-musl": "4.3.0", + "@tailwindcss/oxide-wasm32-wasi": "4.3.0", + "@tailwindcss/oxide-win32-arm64-msvc": "4.3.0", + "@tailwindcss/oxide-win32-x64-msvc": "4.3.0" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.0.tgz", + "integrity": "sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.0.tgz", + "integrity": "sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.0.tgz", + "integrity": "sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.0.tgz", + "integrity": "sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.0.tgz", + "integrity": "sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.0.tgz", + "integrity": "sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.0.tgz", + "integrity": "sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.0.tgz", + "integrity": "sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.0.tgz", + "integrity": "sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.0.tgz", + "integrity": "sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "dev": true, + "optional": true, + "dependencies": { + "@emnapi/core": "^1.10.0", + "@emnapi/runtime": "^1.10.0", + "@emnapi/wasi-threads": "^1.2.1", + "@napi-rs/wasm-runtime": "^1.1.4", + "@tybys/wasm-util": "^0.10.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.0.tgz", + "integrity": "sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.0.tgz", + "integrity": "sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.0.tgz", + "integrity": "sha512-t6J3OrB5Fc0ExuhohouH0fWUGMYL6PTLhW+E7zIk/pdbnJARZDCwjBznFnkh5ynRnIRSI4YjtTH0t6USjJISrw==", + "dev": true, + "dependencies": { + "@tailwindcss/node": "4.3.0", + "@tailwindcss/oxide": "4.3.0", + "tailwindcss": "4.3.0" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", + "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.23.0.tgz", + "integrity": "sha512-yJN/BOOLxcOW2aQgeif9mSnaUB8KtvmMMp56oA1kx1CRfBKbhZm2pJ+NBY+3eOboHxix8lfjWpHE0Ei5U8RbSA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dev": true, + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/laravel-vite-plugin": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-3.1.0.tgz", + "integrity": "sha512-Fzocl+X4eQ9jOi0RwdphYRGkUbPJ3ky1pTAST5Ot18cS2gw6d2vldK2eCrlKDVjtibCjCx5qptYDlA0373n7qg==", + "dev": true, + "dependencies": { + "picocolors": "^1.0.0", + "tinyglobby": "^0.2.12", + "vite-plugin-full-reload": "^1.1.0" + }, + "bin": { + "clean-orphaned-assets": "bin/clean.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "fontaine": "^0.5.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "fontaine": { + "optional": true + } + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", + "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rolldown": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.3.tgz", + "integrity": "sha512-i00lAJ2ks1BYr7rjNjKC7BcqAS7nVfiT3QX1SI5aY+AFHblCmaUf9OE9dbdzDvW6dJxbi2ZCZiy9v3CcwOiX3g==", + "dev": true, + "dependencies": { + "@oxc-project/types": "=0.133.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.3", + "@rolldown/binding-darwin-arm64": "1.0.3", + "@rolldown/binding-darwin-x64": "1.0.3", + "@rolldown/binding-freebsd-x64": "1.0.3", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.3", + "@rolldown/binding-linux-arm64-gnu": "1.0.3", + "@rolldown/binding-linux-arm64-musl": "1.0.3", + "@rolldown/binding-linux-ppc64-gnu": "1.0.3", + "@rolldown/binding-linux-s390x-gnu": "1.0.3", + "@rolldown/binding-linux-x64-gnu": "1.0.3", + "@rolldown/binding-linux-x64-musl": "1.0.3", + "@rolldown/binding-openharmony-arm64": "1.0.3", + "@rolldown/binding-wasm32-wasi": "1.0.3", + "@rolldown/binding-win32-arm64-msvc": "1.0.3", + "@rolldown/binding-win32-x64-msvc": "1.0.3" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tailwindcss": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.0.tgz", + "integrity": "sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==", + "dev": true + }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "optional": true + }, + "node_modules/vite": { + "version": "8.0.16", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.16.tgz", + "integrity": "sha512-h9bXPmJichP5fLmVQo3PyaGSDE2n3aPuomeAlVRm0JLmt4rY6zmPKd59HYI4LNW8oTK7tlTsuC7l/m7awx9Jcw==", + "dev": true, + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.15", + "rolldown": "1.0.3", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.18", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-plugin-full-reload": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-full-reload/-/vite-plugin-full-reload-1.2.0.tgz", + "integrity": "sha512-kz18NW79x0IHbxRSHm0jttP4zoO9P9gXh+n6UTwlNKnviTTEpOlum6oS9SmecrTtSr+muHEn5TUuC75UovQzcA==", + "dev": true, + "dependencies": { + "picocolors": "^1.0.0", + "picomatch": "^2.3.1" + } + }, + "node_modules/vite-plugin-full-reload/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..71dc2af --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://www.schemastore.org/package.json", + "private": true, + "type": "module", + "scripts": { + "build": "vite build", + "dev": "vite" + }, + "devDependencies": { + "@tailwindcss/vite": "^4.0.0", + "laravel-vite-plugin": "^3.1", + "tailwindcss": "^4.0.0", + "vite": "^8.0.0" + } +} diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..7afe4fa --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,9 @@ +parameters: + level: 0 + paths: + - app + - config + - database + - routes + excludePaths: + - database/migrations diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..e7f0a48 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,36 @@ + + + + + tests/Unit + + + tests/Feature + + + + + app + + + + + + + + + + + + + + + + + + + diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..b574a59 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,25 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Handle X-XSRF-Token Header + RewriteCond %{HTTP:x-xsrf-token} . + RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Send Requests To Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..ee8f07e --- /dev/null +++ b/public/index.php @@ -0,0 +1,20 @@ +handleRequest(Request::capture()); diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..eb05362 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/resources/css/app.css b/resources/css/app.css new file mode 100644 index 0000000..ebcc942 --- /dev/null +++ b/resources/css/app.css @@ -0,0 +1,899 @@ +@import 'tailwindcss'; + +@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php'; +@source '../../storage/framework/views/*.php'; +@source '../views/**/*.blade.php'; + +@theme { + --font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', + 'Noto Color Emoji'; +} + +:root { + --bg: #f4f7fb; + --panel: #ffffff; + --ink: #172033; + --muted: #687184; + --line: #dde4ef; + --soft: #eef3f8; + --brand: #156f73; + --brand-dark: #0d5558; + --accent: #f1b544; + --danger: #bf3d3d; + --ok: #2f8756; + --shadow: 0 18px 40px rgba(31, 49, 78, 0.12); +} + +* { + box-sizing: border-box; +} + +body { + margin: 0; + overflow-x: hidden; + background: var(--bg); + color: var(--ink); +} + +input, +select, +textarea, +button { + font: inherit; +} + +.app-shell { + display: grid; + min-height: 100vh; + grid-template-columns: 248px minmax(0, 1fr); +} + +.app-sidebar { + display: flex; + flex-direction: column; + gap: 24px; + background: #102a35; + color: #e9f4f5; + padding: 22px 18px; +} + +.app-brand { + display: flex; + align-items: center; + gap: 12px; + color: #ffffff; + font-size: 18px; + font-weight: 760; + text-decoration: none; +} + +.app-brand-mark { + display: grid; + width: 36px; + height: 36px; + place-items: center; + border-radius: 8px; + background: var(--accent); + color: #102a35; + font-weight: 820; +} + +.app-nav { + display: grid; + gap: 6px; +} + +.app-nav-link, +.app-nav-button { + display: flex; + min-height: 42px; + align-items: center; + gap: 12px; + border: 0; + border-radius: 8px; + background: transparent; + color: #c7dadd; + padding: 0 12px; + text-align: left; + text-decoration: none; +} + +.app-nav-link:hover, +.app-nav-button:hover, +.app-nav-link.active { + background: #1b4655; + color: #ffffff; +} + +.app-nav-ico { + width: 22px; + color: var(--accent); + text-align: center; +} + +.sync-card { + margin-top: auto; + border: 1px solid rgba(255, 255, 255, 0.14); + border-radius: 8px; + background: rgba(255, 255, 255, 0.06); + padding: 14px; +} + +.sync-card strong { + display: block; + margin-bottom: 4px; + font-size: 13px; +} + +.sync-card span { + display: block; + color: #b8ccd0; + font-size: 12px; + line-height: 1.4; +} + +.sync-logout { + margin-top: 10px; + width: 100%; +} + +.app-main { + min-width: 0; + padding: 24px; +} + +.page-wrap { + display: grid; + max-width: 1100px; + gap: 18px; +} + +.page-wrap.wide { + max-width: 1280px; +} + +.page-wrap.narrow { + max-width: 760px; +} + +.topbar { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + margin-bottom: 20px; +} + +.title h1, +.page-title { + margin: 0; + color: var(--ink); + font-size: 28px; + font-weight: 700; + line-height: 1.15; + letter-spacing: 0; +} + +.title p, +.page-subtitle { + margin: 6px 0 0; + color: var(--muted); + font-size: 14px; +} + +.actions { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: flex-end; + gap: 10px; +} + +.panel { + min-width: 0; + overflow: hidden; + border: 1px solid var(--line); + border-radius: 8px; + background: var(--panel); + box-shadow: var(--shadow); +} + +.panel.flush { + overflow: visible; +} + +.composer-panel { + overflow: visible; +} + +.panel-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + border-bottom: 1px solid var(--line); + padding: 18px 18px 12px; +} + +.panel-header h2, +.panel-title { + margin: 0; + color: var(--ink); + font-size: 17px; + font-weight: 700; + letter-spacing: 0; +} + +.panel-body { + padding: 18px; +} + +.stack { + display: grid; + gap: 18px; +} + +.stack-sm { + display: grid; + gap: 12px; +} + +.content-grid { + display: grid; + grid-template-columns: minmax(0, 1fr) 22rem; + gap: 18px; + align-items: start; +} + +.two-col { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 18px; +} + +.stats-grid { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 12px; +} + +.stats-grid.five { + grid-template-columns: repeat(5, minmax(0, 1fr)); +} + +.stats-grid.three { + grid-template-columns: repeat(3, minmax(0, 1fr)); +} + +.stat-card { + border: 1px solid var(--line); + border-radius: 8px; + background: #fbfcfe; + padding: 16px; +} + +.stat-card span { + display: block; + color: var(--muted); + font-size: 13px; + font-weight: 650; +} + +.stat-card strong { + display: block; + margin-top: 8px; + color: var(--ink); + font-size: 27px; + line-height: 1; +} + +.form-grid { + display: grid; + gap: 14px; +} + +.form-grid.cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + +.form-grid.cols-3 { + grid-template-columns: minmax(0, 1fr) 14rem auto; + align-items: end; +} + +.form-grid.search-grid { + grid-template-columns: minmax(0, 1fr) auto; + align-items: end; +} + +.form-grid.filters-grid { + grid-template-columns: repeat(5, minmax(0, 1fr)) auto; + align-items: end; +} + +.form-grid.contact-filters-grid { + grid-template-columns: minmax(14rem, 1.4fr) minmax(11rem, 1fr) minmax(11rem, 1fr) minmax(10rem, 0.8fr) auto; + align-items: end; +} + +.field { + display: grid; + gap: 8px; +} + +.field label, +.field-label { + color: #374053; + font-size: 13px; + font-weight: 700; +} + +.input, +.select, +.textarea { + width: 100%; + border: 1px solid var(--line); + border-radius: 8px; + background: #fbfcfe; + color: var(--ink); + outline: none; + padding: 10px 12px; +} + +.textarea { + min-height: 140px; + resize: vertical; + line-height: 1.5; +} + +.textarea.compact { + min-height: 96px; +} + +.input:focus, +.select:focus, +.textarea:focus { + border-color: var(--brand); + box-shadow: 0 0 0 3px rgba(21, 111, 115, 0.16); +} + +.primary, +.secondary, +.danger, +.icon-button { + display: inline-flex; + min-height: 40px; + align-items: center; + justify-content: center; + gap: 8px; + border: 1px solid var(--line); + border-radius: 8px; + background: var(--panel); + color: var(--ink); + padding: 0 14px; + font-weight: 650; + text-decoration: none; + white-space: nowrap; +} + +.primary { + border-color: var(--brand); + background: var(--brand); + color: #ffffff; + font-weight: 720; +} + +.primary:hover { + background: var(--brand-dark); +} + +.secondary { + background: #ffffff; +} + +.secondary:hover { + background: var(--soft); +} + +.danger { + border-color: #efb1b1; + color: var(--danger); +} + +.danger:hover { + background: #fff1f1; +} + +.icon-button { + width: 40px; + padding: 0; +} + +.tabs { + display: flex; + gap: 4px; + border-radius: 8px; + background: var(--soft); + padding: 4px; +} + +.tabs span, +.tabs a { + border-radius: 6px; + color: var(--muted); + font-size: 13px; + padding: 7px 10px; + text-decoration: none; +} + +.tabs span.active, +.tabs a.active { + background: #ffffff; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); + color: var(--ink); +} + +.badge, +.pill { + display: inline-flex; + min-height: 24px; + align-items: center; + border-radius: 999px; + background: #e7f3f0; + color: var(--ok); + font-size: 12px; + font-weight: 700; + padding: 0 9px; + white-space: nowrap; +} + +.badge.pending, +.pill.warn { + background: #fff1d2; + color: #76530b; +} + +.badge.error, +.pill.error { + background: #ffe8e8; + color: var(--danger); +} + +.summary-row { + display: flex; + flex-wrap: wrap; + gap: 8px; + border: 1px solid var(--line); + border-radius: 8px; + background: #fbfcfe; + padding: 11px; +} + +.message-options { + display: flex; + flex-wrap: wrap; + gap: 12px; +} + +.check-option { + display: inline-flex; + min-height: 38px; + align-items: center; + gap: 8px; + border: 1px solid var(--line); + border-radius: 8px; + background: #fbfcfe; + color: #374053; + font-size: 13px; + font-weight: 700; + padding: 0 12px; +} + +.message-preview { + border: 1px solid var(--line); + border-radius: 8px; + background: #fbfcfe; + padding: 12px; +} + +.message-preview strong { + display: block; + margin-bottom: 8px; + color: #374053; + font-size: 13px; +} + +.message-preview pre { + min-height: 44px; + margin: 0; + color: var(--ink); + font: inherit; + line-height: 1.45; + overflow-wrap: anywhere; + white-space: pre-wrap; +} + +.favorite-row { + border-color: #f1d38a; + background: #fffaf0; +} + +.favorite-star { + color: var(--accent); + font-size: 14px; + line-height: 1; +} + +.recipient-composer { + position: relative; +} + +.recipient-chipbox { + display: flex; + min-height: 48px; + align-items: center; + flex-wrap: wrap; + gap: 8px; + border: 1px solid var(--line); + border-radius: 8px; + background: #fbfcfe; + padding: 7px; +} + +.recipient-chipbox:focus-within { + border-color: var(--brand); + box-shadow: 0 0 0 3px rgba(21, 111, 115, 0.16); +} + +.recipient-chip { + display: inline-flex; + max-width: 100%; + min-height: 30px; + align-items: center; + gap: 7px; + overflow: hidden; + border-radius: 999px; + background: #e7f3f0; + color: #164f4d; + font-size: 13px; + font-weight: 670; + padding: 0 8px 0 10px; + white-space: nowrap; +} + +.recipient-chip.group { + background: #fff1d2; + color: #6c4b05; +} + +.recipient-chip.favorite { + box-shadow: inset 0 0 0 1px #f1b544; +} + +.recipient-chip span { + overflow: hidden; + text-overflow: ellipsis; +} + +.recipient-chip button { + display: grid; + width: 20px; + height: 20px; + place-items: center; + border: 0; + border-radius: 50%; + background: rgba(0, 0, 0, 0.08); + color: inherit; + padding: 0; +} + +.recipient-input { + min-width: 220px; + flex: 1; + border: 0; + background: transparent; + color: var(--ink); + outline: none; + padding: 7px; +} + +.recipient-results { + position: absolute; + z-index: 20; + right: 0; + left: 0; + margin-top: 6px; + max-height: 60vh; + overflow-y: auto; + border: 1px solid var(--line); + border-radius: 8px; + background: #ffffff; + box-shadow: var(--shadow); +} + +.recipient-result { + display: grid; + width: 100%; + grid-template-columns: minmax(0, 1fr) auto; + gap: 8px; + border: 0; + border-bottom: 1px solid var(--line); + background: #ffffff; + color: var(--ink); + padding: 11px 12px; + text-align: left; +} + +.recipient-result:last-child { + border-bottom: 0; +} + +.recipient-result:hover, +.recipient-result.active { + background: #fbfcfe; +} + +.recipient-result strong, +.recipient-result span { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.recipient-result small { + color: var(--muted); + font-size: 12px; +} + +.inline-badges { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.check-row { + grid-template-columns: auto minmax(0, 1fr); + align-items: center; +} + +.final-recipient-row { + grid-template-columns: minmax(0, 1fr) 10rem; + align-items: center; +} + +.flex-fill { + flex: 1; +} + +.h-offset { + margin-top: 10px; +} + +.mt-sm { + margin-top: 4px; +} + +.mt-md { + margin-top: 14px; +} + +.nowrap-actions { + flex-wrap: nowrap; +} + +.item-title { + display: block; + font-weight: 650; +} + +.item-line { + display: flex; + align-items: center; + gap: 8px; +} + +.item-meta { + display: block; + color: var(--muted); + font-size: 13px; +} + +.text-small { + font-size: 13px; +} + +.text-strong { + font-weight: 650; +} + +.text-section { + font-size: 13px; + font-weight: 700; +} + +.message-text { + white-space: pre-line; + font-size: 14px; +} + +.audit-list { + font-size: 14px; +} + +.audit-term { + color: var(--muted); + font-weight: 650; +} + +.audit-value { + margin-top: 4px; +} + +.table-wrap { + overflow-x: auto; +} + +.data-table { + width: 100%; + border-collapse: collapse; +} + +.data-table th, +.data-table td { + border-bottom: 1px solid var(--line); + padding: 13px 16px; + text-align: left; + vertical-align: middle; + font-size: 13px; +} + +.data-table th { + background: #fbfcfe; + color: var(--muted); + font-weight: 720; +} + +.data-table tr:last-child td { + border-bottom: 0; +} + +.list-row { + display: grid; + gap: 12px; + border-bottom: 1px solid var(--line); + color: inherit; + padding: 14px 16px; + text-decoration: none; +} + +.list-row:hover { + background: #fbfcfe; +} + +.list-row:last-child { + border-bottom: 0; +} + +.muted { + color: var(--muted); +} + +.truncate { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.empty-state { + padding: 34px 18px; + text-align: center; + color: var(--muted); + font-size: 14px; +} + +.notice { + border: 1px solid #b8ded7; + border-radius: 8px; + background: #e7f3f0; + color: #164f4d; + padding: 10px 12px; + font-size: 14px; + font-weight: 650; +} + +.flash { + margin-bottom: 18px; +} + +.notice.error { + border-color: #efb1b1; + background: #ffe8e8; + color: var(--danger); +} + +.link { + color: var(--brand); + font-size: 14px; + font-weight: 650; + text-decoration: none; +} + +.link:hover { + color: var(--brand-dark); +} + +@media (max-width: 1080px) { + .app-shell { + grid-template-columns: 1fr; + } + + .app-sidebar { + position: static; + } + + .app-nav { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + + .sync-card { + margin-top: 0; + } + + .content-grid, + .two-col { + grid-template-columns: 1fr; + } + + .stats-grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .stats-grid.five, + .stats-grid.three, + .form-grid.contact-filters-grid, + .form-grid.filters-grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } +} + +@media (max-width: 680px) { + .app-main { + padding: 16px; + } + + .topbar, + .panel-header { + align-items: stretch; + flex-direction: column; + } + + .actions, + .primary, + .secondary, + .danger { + width: 100%; + } + + .actions { + display: grid; + grid-template-columns: 1fr; + } + + .app-nav, + .form-grid.cols-2, + .form-grid.cols-3, + .form-grid.search-grid, + .form-grid.contact-filters-grid, + .form-grid.filters-grid, + .stats-grid.five, + .stats-grid.three, + .stats-grid { + grid-template-columns: 1fr; + } + + .data-table { + min-width: 620px; + } +} diff --git a/resources/js/app.js b/resources/js/app.js new file mode 100644 index 0000000..64d8308 --- /dev/null +++ b/resources/js/app.js @@ -0,0 +1,274 @@ +const debounce = (callback, delay = 180) => { + let timeout; + + return (...args) => { + clearTimeout(timeout); + timeout = setTimeout(() => callback(...args), delay); + }; +}; + +const createRecipientChip = (candidate) => { + const chip = document.createElement('span'); + chip.className = [ + 'recipient-chip', + candidate.type === 'group' ? 'group' : '', + candidate.is_favorite ? 'favorite' : '', + ].filter(Boolean).join(' '); + chip.dataset.recipientToken = ''; + chip.dataset.type = candidate.type; + chip.dataset.id = String(candidate.id); + + const label = document.createElement('span'); + label.textContent = candidate.label; + + const remove = document.createElement('button'); + remove.type = 'button'; + remove.dataset.recipientRemove = ''; + remove.setAttribute('aria-label', `Retirer ${candidate.label}`); + remove.textContent = '×'; + + const hidden = document.createElement('input'); + hidden.type = 'hidden'; + hidden.name = candidate.type === 'group' ? 'group_ids[]' : 'contact_ids[]'; + hidden.value = String(candidate.id); + + chip.append(label, remove, hidden); + + return chip; +}; + +const initRecipientComposer = (composer) => { + const searchUrl = composer.dataset.searchUrl; + const selected = composer.querySelector('[data-recipient-selected]'); + const input = composer.querySelector('[data-recipient-input]'); + const results = composer.querySelector('[data-recipient-results]'); + + if (!searchUrl || !selected || !input || !results) { + return; + } + + const selectedKeys = new Set( + [...selected.querySelectorAll('[data-recipient-token]')].map((chip) => `${chip.dataset.type}:${chip.dataset.id}`), + ); + let candidates = []; + let activeIndex = -1; + + const hideResults = () => { + results.hidden = true; + results.replaceChildren(); + activeIndex = -1; + }; + + const addCandidate = (candidate) => { + const key = `${candidate.type}:${candidate.id}`; + + if (selectedKeys.has(key)) { + input.value = ''; + hideResults(); + return; + } + + selectedKeys.add(key); + selected.insertBefore(createRecipientChip(candidate), input); + input.value = ''; + hideResults(); + input.focus(); + }; + + const renderResults = () => { + results.replaceChildren(); + + if (candidates.length === 0) { + const empty = document.createElement('div'); + empty.className = 'recipient-result'; + empty.textContent = 'Aucun resultat'; + results.append(empty); + results.hidden = false; + return; + } + + candidates.forEach((candidate, index) => { + const button = document.createElement('button'); + button.type = 'button'; + button.className = `recipient-result${index === activeIndex ? ' active' : ''}`; + button.dataset.index = String(index); + + const main = document.createElement('span'); + const title = document.createElement('strong'); + title.textContent = `${candidate.is_favorite ? '★ ' : ''}${candidate.label}`; + const meta = document.createElement('small'); + meta.textContent = candidate.meta || candidate.source || ''; + main.append(title, document.createElement('br'), meta); + + const type = document.createElement('small'); + type.textContent = candidate.type === 'group' ? 'Groupe' : 'Contact'; + + button.append(main, type); + button.addEventListener('mousedown', (event) => { + event.preventDefault(); + addCandidate(candidate); + }); + results.append(button); + }); + + results.hidden = false; + }; + + const fitResultsToViewport = () => { + const rect = results.getBoundingClientRect(); + const availableHeight = window.innerHeight - rect.top - 16; + results.style.maxHeight = `${Math.max(180, availableHeight)}px`; + }; + + const search = debounce(async () => { + const query = input.value.trim(); + const url = new URL(searchUrl, window.location.origin); + url.searchParams.set('q', query); + + const response = await fetch(url, { + headers: { + Accept: 'application/json', + }, + }); + + if (!response.ok) { + hideResults(); + return; + } + + const payload = await response.json(); + candidates = (payload.results || []).filter( + (candidate) => !selectedKeys.has(`${candidate.type}:${candidate.id}`), + ); + activeIndex = candidates.length > 0 ? 0 : -1; + renderResults(); + fitResultsToViewport(); + }); + + input.addEventListener('input', search); + input.addEventListener('focus', search); + window.addEventListener('resize', fitResultsToViewport); + input.addEventListener('keydown', (event) => { + if (event.key === 'Escape') { + hideResults(); + return; + } + + if (event.key === 'Backspace' && input.value === '') { + const chip = input.previousElementSibling; + if (chip?.matches('[data-recipient-token]')) { + selectedKeys.delete(`${chip.dataset.type}:${chip.dataset.id}`); + chip.remove(); + } + return; + } + + if (results.hidden || candidates.length === 0) { + return; + } + + if (event.key === 'ArrowDown') { + event.preventDefault(); + activeIndex = (activeIndex + 1) % candidates.length; + renderResults(); + } + + if (event.key === 'ArrowUp') { + event.preventDefault(); + activeIndex = (activeIndex - 1 + candidates.length) % candidates.length; + renderResults(); + } + + if (event.key === 'Enter' && activeIndex >= 0) { + event.preventDefault(); + addCandidate(candidates[activeIndex]); + } + }); + + selected.addEventListener('click', (event) => { + const remove = event.target.closest('[data-recipient-remove]'); + + if (!remove) { + return; + } + + const chip = remove.closest('[data-recipient-token]'); + selectedKeys.delete(`${chip.dataset.type}:${chip.dataset.id}`); + chip.remove(); + input.focus(); + }); + + document.addEventListener('click', (event) => { + if (!composer.contains(event.target)) { + hideResults(); + } + }); +}; + +document.querySelectorAll('[data-recipient-composer]').forEach(initRecipientComposer); + +const initScheduleControls = (toggle) => { + const form = toggle.closest('form'); + const panel = form?.querySelector('[data-schedule-panel]'); + const input = form?.querySelector('[data-schedule-input]'); + const submit = form?.querySelector('[data-schedule-submit]'); + + if (!form || !panel || !input || !submit) { + return; + } + + const showPanel = () => { + panel.hidden = false; + submit.hidden = false; + input.required = true; + toggle.setAttribute('aria-expanded', 'true'); + input.focus(); + }; + + if (!panel.hidden) { + input.required = true; + } + + toggle.addEventListener('click', showPanel); +}; + +document.querySelectorAll('[data-schedule-toggle]').forEach(initScheduleControls); + +const initMessageComposer = (composer) => { + const form = composer.closest('form'); + const body = form?.querySelector('[data-message-body]'); + const includeHeader = composer.querySelector('[data-message-include-header]'); + const includeFooter = composer.querySelector('[data-message-include-footer]'); + const preview = composer.querySelector('[data-message-preview]'); + const header = composer.dataset.header || ''; + const footer = composer.dataset.footer || ''; + + if (!form || !body || !preview) { + return; + } + + const render = () => { + const parts = []; + + if (includeHeader?.checked && header.trim() !== '') { + parts.push(header.trim()); + } + + if (body.value.trim() !== '') { + parts.push(body.value.trim()); + } + + if (includeFooter?.checked && footer.trim() !== '') { + parts.push(footer.trim()); + } + + preview.textContent = parts.join('\n'); + }; + + body.addEventListener('input', render); + includeHeader?.addEventListener('change', render); + includeFooter?.addEventListener('change', render); + render(); +}; + +document.querySelectorAll('[data-message-composer]').forEach(initMessageComposer); diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php new file mode 100644 index 0000000..c39f08c --- /dev/null +++ b/resources/views/auth/login.blade.php @@ -0,0 +1,54 @@ +@extends('layouts.app') + +@section('content') +
+
+

Connexion

+ +
+ @csrf + +
+ + + @error('email') +

{{ $message }}

+ @enderror +
+ +
+ + + @error('password') +

{{ $message }}

+ @enderror +
+ + + + +
+
+
+@endsection diff --git a/resources/views/contact-groups/edit.blade.php b/resources/views/contact-groups/edit.blade.php new file mode 100644 index 0000000..8ec11ef --- /dev/null +++ b/resources/views/contact-groups/edit.blade.php @@ -0,0 +1,112 @@ +@extends('layouts.app') + +@section('content') +
+
+
+ Retour aux contacts +

Modifier le groupe

+

{{ $group->contacts_count }} contact(s) · groupe local

+
+
+ +
+ @csrf + @method('PUT') + + +
+

Informations

+
+ +
+
+
+ + + @error('name') +

{{ $message }}

+ @enderror +
+ + +
+ +
+ + +
+
+ +
+

Membres

+ {{ count($selectedContactIds) }} selectionne(s) +
+ +
+ + + + + + + + + + + @forelse ($contacts as $contact) + @php($primaryPhone = $contact->phoneNumbers->firstWhere('is_primary', true) ?? $contact->phoneNumbers->first()) + + + + + + + @empty + + + + @endforelse + +
InclureContactTelephoneSource
+ id, old('contact_ids', $selectedContactIds), false)) + > + + {{ $contact->displayName() }} +
{{ $contact->email ?: $contact->organization ?: 'Sans detail' }}
+
{{ $primaryPhone?->normalized_number ?: $primaryPhone?->raw_number ?: 'Aucun' }} + + {{ ucfirst($contact->source) }} + +
Aucun contact disponible.
+
+ +
+
+ + Annuler +
+
+
+ +
+ @csrf + @method('DELETE') + +
+

Suppression

+
+
+

La suppression retire le groupe des contacts associes.

+ +
+
+
+@endsection diff --git a/resources/views/contacts/create.blade.php b/resources/views/contacts/create.blade.php new file mode 100644 index 0000000..3187aca --- /dev/null +++ b/resources/views/contacts/create.blade.php @@ -0,0 +1,113 @@ +@extends('layouts.app') + +@section('content') +
+
+ Retour aux contacts +

Nouveau contact

+
+ +
+ @csrf + +
+

Identite

+ +
+
+ + + @error('first_name') +

{{ $message }}

+ @enderror +
+ +
+ + + @error('last_name') +

{{ $message }}

+ @enderror +
+ +
+ + +
+ +
+ + + @error('email') +

{{ $message }}

+ @enderror +
+
+ +
+ + +
+
+ +
+

Telephone

+ +
+
+ + +
+ +
+ + + @error('raw_phone_number') +

{{ $message }}

+ @enderror +
+
+
+ +
+

Groupes et options

+ +
+ @forelse ($groups as $group) + + @empty +

Aucun groupe disponible.

+ @endforelse +
+ +
+ + + +
+
+ +
+ Annuler + +
+
+
+@endsection diff --git a/resources/views/contacts/edit.blade.php b/resources/views/contacts/edit.blade.php new file mode 100644 index 0000000..5c7cfcf --- /dev/null +++ b/resources/views/contacts/edit.blade.php @@ -0,0 +1,127 @@ +@extends('layouts.app') + +@section('content') +
+
+ Retour au contact +

Modifier le contact

+
+ +
+ @csrf + @method('PUT') + +
+

Identite

+ +
+
+ + + @error('first_name') +

{{ $message }}

+ @enderror +
+ +
+ + + @error('last_name') +

{{ $message }}

+ @enderror +
+ +
+ + +
+ +
+ + + @error('email') +

{{ $message }}

+ @enderror +
+
+ +
+ + +
+
+ +
+

Telephone principal

+ +
+
+ + +
+ +
+ + + @error('raw_phone_number') +

{{ $message }}

+ @enderror +
+
+
+ +
+

Groupes et options

+ +
+ @php($selectedGroups = old('group_ids', $contact->groups->pluck('id')->all())) + + @forelse ($groups as $group) + + @empty +

Aucun groupe disponible.

+ @endforelse +
+ +
+ + + +
+
+ +
+ + +
+ Annuler + +
+
+
+ +
+ @csrf + @method('DELETE') +
+
+@endsection diff --git a/resources/views/contacts/index.blade.php b/resources/views/contacts/index.blade.php new file mode 100644 index 0000000..57c0850 --- /dev/null +++ b/resources/views/contacts/index.blade.php @@ -0,0 +1,264 @@ +@extends('layouts.app') + +@section('content') + @php + $baseFilters = array_filter([ + 'q' => $search, + 'group' => $selectedGroupId ?: null, + 'mobile' => $selectedMobileFilter, + ], fn ($value) => $value !== null && $value !== ''); + @endphp + +
+
+
+

Contacts

+

+ Contacts locaux, groupes et recherche. + @if ($lastCardDavSyncRun) + CardDAV : {{ $lastCardDavSyncRun->status }} · {{ $lastCardDavSyncRun->started_at?->diffForHumans() }} + @endif +

+
+ +
+ @if ($cardDavSyncEnabled) +
+ @csrf + +
+ @endif + + + + Contact local + +
+
+ +
+
+
+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+
+ +
+
+

Liste des contacts

+ +
+ +
+ + + + + + + + + + + @forelse ($contacts as $contact) + @php($primaryPhone = $contact->phoneNumbers->firstWhere('is_primary', true) ?? $contact->phoneNumbers->first()) + + + + + + + @empty + + + + @endforelse + +
ContactTelephoneGroupesStatut
+ + @if ($contact->is_favorite) + ★ + @endif + {{ $contact->displayName() }} + +
{{ $contact->email ?: $contact->organization ?: ucfirst($contact->source) }}
+
+ @if ($primaryPhone) + {{ $primaryPhone->normalized_number ?: $primaryPhone->raw_number }} + @if (! $primaryPhone->is_valid) +
Numero invalide
+ @elseif (! $primaryPhone->hasDetectedMobileNumber()) +
Non mobile
+ @else +
Mobile detecte
+ @endif + @else + Aucun + @endif +
{{ $contact->groups_count }} + + @if ($contact->is_favorite) + Favori + @endif + @if ($contact->sms_opt_out) + Refus SMS + @endif + @if (! $contact->is_favorite && ! $contact->sms_opt_out) + Actif + @endif + +
+ @csrf + @method('PATCH') + + +
+
+ @csrf + @method('PATCH') + + +
+
Aucun contact trouve.
+
+
+ + {{ $contacts->links() }} +
+ + +
+
+@endsection diff --git a/resources/views/contacts/show.blade.php b/resources/views/contacts/show.blade.php new file mode 100644 index 0000000..4d1f6cb --- /dev/null +++ b/resources/views/contacts/show.blade.php @@ -0,0 +1,151 @@ +@extends('layouts.app') + +@section('content') +
+
+ Retour aux contacts +
+
+

{{ $contact->displayName() }}

+

{{ $contact->organization ?: ucfirst($contact->source) }}

+
+ +
+
+ @if ($contact->is_favorite) + Favori + @endif + @if ($contact->sms_opt_out) + Refus SMS + @endif +
+ +
+ @csrf + @method('PATCH') + + +
+ +
+ @csrf + @method('PATCH') + + +
+ + @if ($contact->source === 'local') +
+ + Modifier + + +
+ @csrf + @method('DELETE') + +
+
+ @else + + Fiche importee non modifiable + + @endif +
+
+
+ + @if (session('status')) +
+ {{ session('status') }} +
+ @endif + +
+
+
+

Coordonnees

+ +
+
+
Email
+
{{ $contact->email ?: 'Non renseigne' }}
+
+
+
Source
+
{{ $contact->source }}
+
+ @if ($contact->synced_at) +
+
Derniere synchro
+
{{ $contact->synced_at->format('d/m/Y H:i') }}
+
+ @endif +
+
+ +
+

Numeros

+ +
+ @forelse ($contact->phoneNumbers as $phoneNumber) +
+
+
+

{{ $phoneNumber->label ?: 'Telephone' }}

+

{{ $phoneNumber->normalized_number ?: $phoneNumber->raw_number }}

+ @if ($phoneNumber->normalized_number) +

Brut : {{ $phoneNumber->raw_number }}

+ @endif +
+ +
+ + {{ $phoneNumber->is_valid ? 'Valide' : 'Invalide' }} + + + {{ $phoneNumber->hasDetectedMobileNumber() ? 'Mobile' : 'Non mobile' }} + +
+
+ + @if ($phoneNumber->validation_error) +

{{ $phoneNumber->validation_error }}

+ @endif +
+ @empty +

Aucun numero.

+ @endforelse +
+
+ + @if ($contact->notes) +
+

Notes

+

{{ $contact->notes }}

+
+ @endif +
+ + +
+
+@endsection diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php new file mode 100644 index 0000000..5cb0f55 --- /dev/null +++ b/resources/views/layouts/app.blade.php @@ -0,0 +1,93 @@ + + + + + + + + {{ config('app.name', 'RelaisSMS') }} + + @if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot'))) + @vite(['resources/css/app.css', 'resources/js/app.js']) + @endif + + + @auth +
+ + +
+ @if (session('status')) +
+ {{ session('status') }} +
+ @endif + + @if (session('error')) +
+ {{ session('error') }} +
+ @endif + + @yield('content') +
+
+ @else +
+ @if (session('status')) +
+ {{ session('status') }} +
+ @endif + + @if (session('error')) +
+ {{ session('error') }} +
+ @endif + + @yield('content') +
+ @endauth + + diff --git a/resources/views/recipients/index.blade.php b/resources/views/recipients/index.blade.php new file mode 100644 index 0000000..8964ed1 --- /dev/null +++ b/resources/views/recipients/index.blade.php @@ -0,0 +1,292 @@ +@extends('layouts.app') + +@section('content') + @php + $reasonLabels = [ + 'opt_out' => 'Refus SMS', + 'missing_phone' => 'Sans telephone', + 'invalid' => 'Numero invalide', + 'non_mobile' => 'Non mobile', + 'duplicate' => 'Doublon', + ]; + $summary = $resolution?->summary(); + $showSchedulePanel = old('send_mode', request('send_mode')) === 'scheduled' || old('scheduled_at', request('scheduled_at')); + @endphp + +
+
+
+

Composer

+

Selectionner les destinataires et saisir le SMS.

+
+ + +
+ + @error('selection') +
+ {{ $message }} +
+ @enderror + +
+ @csrf + + +
+
+

Destination

+
+ +
+
+ +
+
+ @foreach ($selectedGroups as $group) + + {{ $group->name }} + + + + @endforeach + + @foreach ($selectedContacts as $contact) + + {{ $contact->displayName() }} + + + + @endforeach + + +
+ +
+
+ +
+ + + @error('message') +

{{ $message }}

+ @enderror +
+ + @if ($smsHeader !== '' || $smsFooter !== '') +
+
+ @if ($smsHeader !== '') + + + @endif + + @if ($smsFooter !== '') + + + @endif +
+ +
+ SMS complet +
{{ $composedMessage }}
+
+
+ @endif + + + +
+ + @if ($resolution && $resolution->recipients !== []) + + + + @endif +
+ + @if ($resolution) +
+ {{ count($resolution->recipients) }} numeros valides + 1 SMS / destinataire + {{ $summary['excluded_total'] }} exclus + {{ $summary['duplicate'] }} doublons +
+ @endif +
+
+
+ + @if ($resolution) +
+
+
+ Numeros prets + {{ $summary['ready_numbers'] }} +
+
+ Contacts + {{ $summary['selected_contacts'] }} +
+
+ Groupes + {{ $summary['selected_groups'] }} +
+
+ Exclus + {{ $summary['excluded_total'] }} +
+
+ Doublons + {{ $summary['duplicate'] }} +
+
+ +
+
+
+

Liste finale

+
+ +
+ @forelse ($resolution->recipients as $recipient) +
+
+

{{ $recipient['contact_name'] }}

+

{{ implode(' · ', $recipient['selection']) }}

+
+

{{ $recipient['number'] }}

+
+ @empty +
Aucun numero pret.
+ @endforelse +
+
+ +
+
+

Ecarts

+
+ +
+ @foreach ($reasonLabels as $reason => $label) + @php($entries = $resolution->excludedByReason($reason)) + @if ($entries !== []) +
+

{{ $label }} · {{ count($entries) }}

+
+ @foreach ($entries as $entry) +
+

{{ $entry['contact_name'] }}

+

+ {{ ucfirst($entry['contact_source'] ?? 'local') }} #{{ $entry['contact_id'] }} +

+

+ {{ $entry['number'] ?: $entry['raw_number'] ?: 'Aucun numero' }} + @if (($entry['duplicate_of'] ?? null) !== null) + · deja retenu pour {{ $entry['duplicate_of'] }} + @endif +

+
+ @endforeach +
+
+ @endif + @endforeach + + @if ($resolution->excluded === []) +
Aucun ecart.
+ @endif +
+
+
+
+ @endif +
+@endsection diff --git a/resources/views/settings/edit.blade.php b/resources/views/settings/edit.blade.php new file mode 100644 index 0000000..50689c0 --- /dev/null +++ b/resources/views/settings/edit.blade.php @@ -0,0 +1,57 @@ +@extends('layouts.app') + +@section('content') +
+
+
+

Parametres

+

Textes ajoutes par defaut autour des SMS.

+
+
+ +
+ @csrf + @method('PUT') + +
+

Composition SMS

+
+ +
+
+ + + @error('sms_message_header') +

{{ $message }}

+ @enderror +
+ +
+ + + @error('sms_message_footer') +

{{ $message }}

+ @enderror +
+ +
+ +
+
+
+
+@endsection diff --git a/resources/views/sms-campaigns/index.blade.php b/resources/views/sms-campaigns/index.blade.php new file mode 100644 index 0000000..0fce1b5 --- /dev/null +++ b/resources/views/sms-campaigns/index.blade.php @@ -0,0 +1,129 @@ +@extends('layouts.app') + +@section('content') +
+
+
+

Historique SMS

+

Recherche, audit et export des campagnes SMS.

+
+ + +
+ +
+
+
+ + + + + + + + + + +
+ + + Reset + +
+
+
+
+ +
+
+

Campagnes

+
+ Toutes + Envoyees + Erreurs +
+
+ +
+ + + + + + + + + + + + + @forelse ($campaigns as $campaign) + + + + + + + + + @empty + + + + @endforelse + +
DateProgrammationMessageDestinatairesGroupesStatut
+ {{ $campaign->created_at->format('d/m/Y H:i') }} +
{{ $campaign->user?->name ?: 'Utilisateur supprime' }}
+
+ {{ $campaign->scheduled_at?->timezone(config('relais_sms.default_settings.display_timezone', 'Europe/Paris'))->format('d/m/Y H:i') ?: '-' }} + {{ $campaign->message }}{{ $campaign->sent_count }}/{{ $campaign->recipients_count }} envoye(s){{ implode(', ', $campaign->selected_group_names ?? []) ?: 'Aucun groupe' }} + + {{ $statuses[$campaign->status] ?? $campaign->status }} + +
Aucune campagne ne correspond aux filtres.
+
+
+ + {{ $campaigns->links() }} +
+@endsection diff --git a/resources/views/sms-campaigns/show.blade.php b/resources/views/sms-campaigns/show.blade.php new file mode 100644 index 0000000..822220a --- /dev/null +++ b/resources/views/sms-campaigns/show.blade.php @@ -0,0 +1,142 @@ +@extends('layouts.app') + +@section('content') + @php + $displayTimezone = config('relais_sms.default_settings.display_timezone', 'Europe/Paris'); + $statusLabels = [ + 'draft' => 'Brouillon', + 'scheduled' => 'Programme', + 'sending' => 'Envoi', + 'uncertain' => 'A verifier', + 'sent' => 'Envoye', + 'partial' => 'Partiel', + 'failed' => 'Echec', + 'canceled' => 'Annule', + 'queued' => 'En attente', + ]; + @endphp + +
+
+
+ Retour a l'historique +

Campagne #{{ $campaign->id }}

+

{{ $campaign->created_at->format('d/m/Y H:i') }} par {{ $campaign->user?->name ?: 'Utilisateur supprime' }}

+
+ +
+ @if ($campaign->status === 'scheduled') +
+ @csrf + @method('PATCH') + +
+ @endif + + + {{ $statusLabels[$campaign->status] ?? $campaign->status }} + +
+
+ +
+
+ Destinataires + {{ $campaign->recipients_count }} +
+
+ Envoyes + {{ $campaign->sent_count }} +
+
+ Echecs + {{ $campaign->failed_count }} +
+
+ + @if ($campaign->status === 'uncertain') +

{{ $campaign->recipients_count - $campaign->sent_count - $campaign->failed_count }} destinataire(s) a verifier. Un delai d attente ne signifie pas que les SMS ont echoue. La verification automatique consulte OVH sans renvoyer de SMS. Ne pas renvoyer cette campagne.

+ @endif + +
+
+

Message

+
+
+

{{ $campaign->message }}

+ + @if ($campaign->error_message) +

{{ $campaign->error_message }}

+ @endif +
+
+ +
+
+

Audit

+
+
+
+
Utilisateur
+
{{ $campaign->user?->name ?: 'Utilisateur supprime' }}
+
+
+
Cree le
+
{{ $campaign->created_at->format('d/m/Y H:i') }}
+
+
+
Programme le
+
{{ $campaign->scheduled_at?->timezone($displayTimezone)->format('d/m/Y H:i') ?: 'Non programme' }}
+
+
+
Annule le
+
{{ $campaign->canceled_at?->timezone($displayTimezone)->format('d/m/Y H:i') ?: 'Non annule' }}
+
+
+
Groupes selectionnes
+
{{ implode(', ', $campaign->selected_group_names ?? []) ?: 'Aucun groupe' }}
+
+
+
+ +
+
+

Destinataires

+
+ +
+ + + + + + + + + + @foreach ($campaign->deliveries as $delivery) + + + + + + @endforeach + +
ContactNumeroStatut
+ {{ $delivery->contact_name }} +
{{ $delivery->provider_message_id ?: $delivery->error_message }}
+
{{ $delivery->number }} + + {{ $statusLabels[$delivery->status] ?? $delivery->status }} + +
+
+
+
+@endsection diff --git a/routes/console.php b/routes/console.php new file mode 100644 index 0000000..f947a8c --- /dev/null +++ b/routes/console.php @@ -0,0 +1,25 @@ +hourly() + ->when(fn (): bool => (bool) config('relais_sms.default_settings.carddav_sync_enabled')); + +Schedule::command('calendar:process-reminders') + ->everyMinute() + ->withoutOverlapping() + ->when(fn (): bool => (bool) config('relais_sms.default_settings.caldav_calendar_sync_enabled')); + +Schedule::command('sms-campaigns:send-due') + ->everyMinute() + ->withoutOverlapping() + ->when(fn (): bool => (bool) config('relais_sms.default_settings.scheduled_sends_enabled')); + +Schedule::command('sms-campaigns:prune-history') + ->dailyAt('02:30') + ->withoutOverlapping(); + +Schedule::command('sms-campaigns:reconcile') + ->everyMinute() + ->withoutOverlapping(); diff --git a/routes/web.php b/routes/web.php new file mode 100644 index 0000000..8f815bd --- /dev/null +++ b/routes/web.php @@ -0,0 +1,43 @@ +route('recipients.index'); +}); + +Route::match(['GET', 'POST'], 'ovh/sms/stop-callback', OvhStopCallbackController::class) + ->name('ovh.sms.stop-callback'); + +Route::middleware('guest')->group(function () { + Route::get('login', [AuthenticatedSessionController::class, 'create'])->name('login'); + Route::post('login', [AuthenticatedSessionController::class, 'store']); +}); + +Route::middleware('auth')->group(function () { + Route::get('recipients', [RecipientSelectionController::class, 'index'])->name('recipients.index'); + Route::get('recipients/search', [RecipientSelectionController::class, 'search'])->name('recipients.search'); + Route::post('recipients/preview', [RecipientSelectionController::class, 'preview'])->name('recipients.preview'); + Route::post('sms-campaigns', [SmsCampaignController::class, 'store'])->name('sms-campaigns.store'); + Route::get('sms-campaigns', [SmsCampaignController::class, 'index'])->name('sms-campaigns.index'); + Route::get('sms-campaigns/export', [SmsCampaignController::class, 'export'])->name('sms-campaigns.export'); + Route::patch('sms-campaigns/{smsCampaign}/cancel', [SmsCampaignController::class, 'cancel'])->name('sms-campaigns.cancel'); + Route::get('sms-campaigns/{smsCampaign}', [SmsCampaignController::class, 'show'])->name('sms-campaigns.show'); + Route::post('contacts/sync-carddav', CardDavSyncController::class)->name('contacts.sync-carddav'); + Route::patch('contacts/{contact}/favorite', [ContactController::class, 'favorite'])->name('contacts.favorite'); + Route::patch('contacts/{contact}/opt-out', [ContactController::class, 'optOut'])->name('contacts.opt-out'); + Route::resource('contacts', ContactController::class)->except(['destroy']); + Route::delete('contacts/{contact}', [ContactController::class, 'destroy'])->name('contacts.destroy'); + Route::resource('contact-groups', ContactGroupController::class)->only(['store', 'edit', 'update', 'destroy']); + Route::get('settings', [SettingsController::class, 'edit'])->name('settings.edit'); + Route::put('settings', [SettingsController::class, 'update'])->name('settings.update'); + Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout'); +}); diff --git a/storage/app/.gitignore b/storage/app/.gitignore new file mode 100644 index 0000000..fedb287 --- /dev/null +++ b/storage/app/.gitignore @@ -0,0 +1,4 @@ +* +!private/ +!public/ +!.gitignore diff --git a/storage/app/private/.gitignore b/storage/app/private/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/app/private/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/app/public/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore new file mode 100644 index 0000000..05c4471 --- /dev/null +++ b/storage/framework/.gitignore @@ -0,0 +1,9 @@ +compiled.php +config.php +down +events.scanned.php +maintenance.php +routes.php +routes.scanned.php +schedule-* +services.json diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore new file mode 100644 index 0000000..01e4a6c --- /dev/null +++ b/storage/framework/cache/.gitignore @@ -0,0 +1,3 @@ +* +!data/ +!.gitignore diff --git a/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/cache/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/sessions/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/testing/.gitignore b/storage/framework/testing/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/testing/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/views/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/logs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/Feature/Calendar/CalendarReminderProcessingTest.php b/tests/Feature/Calendar/CalendarReminderProcessingTest.php new file mode 100644 index 0000000..a80f78a --- /dev/null +++ b/tests/Feature/Calendar/CalendarReminderProcessingTest.php @@ -0,0 +1,291 @@ +create(); + $contact = Contact::query()->create(['source' => 'local', 'first_name' => 'Contact', 'last_name' => 'Test']); + $contact->phoneNumbers()->create([ + 'raw_number' => '06 11 11 11 11', 'normalized_number' => '+33611111111', + 'country' => 'FR', 'is_valid' => true, 'is_mobile' => true, 'is_primary' => true, + ]); + config(['relais_sms.caldav.default_contact_ids' => [$contact->id]]); + $this->mock(SmsProviderInterface::class)->shouldReceive('send')->once() + ->andThrow(new SmsProviderException('Timeout', outcomeUnknown: true)); + $ical = "BEGIN:VCALENDAR\nVERSION:2.0\nBEGIN:VEVENT\nUID:uncertain-reminder\nSUMMARY:Reunion\nDTSTART:20261006T140000Z\nBEGIN:VALARM\nACTION:DISPLAY\nTRIGGER:-PT1H\nEND:VALARM\nEND:VEVENT\nEND:VCALENDAR"; + $this->mock(CalendarClientInterface::class)->shouldReceive('fetchEvents')->twice() + ->andReturn([new CalendarRemoteEvent(href: '/calendar/uncertain.ics', etag: 'etag', ical: $ical)]); + $this->artisan('calendar:process-reminders --force-sync')->assertSuccessful(); + $this->assertDatabaseHas('calendar_reminders', ['status' => 'uncertain', 'sent_at' => null]); + $this->artisan('calendar:process-reminders --force-sync')->assertSuccessful(); + $this->assertSame(1, SmsCampaign::query()->count()); + $this->assertDatabaseHas('calendar_reminders', ['status' => 'uncertain']); + Carbon::setTestNow(); + } + + public function test_expired_pre_event_reminder_is_skipped_without_calling_the_sms_provider(): void + { + $this->mock(SmsProviderInterface::class)->shouldNotReceive('send'); + $event = CalendarEvent::query()->create([ + 'source' => 'caldav', + 'external_id' => 'expired-reminder', + 'summary' => 'Reunion passee', + 'starts_at' => '2026-09-30 08:00:00', + ]); + $reminder = $event->reminders()->create([ + 'reminder_key' => 'expired', + 'action' => 'DISPLAY', + 'remind_at' => '2026-09-30 07:00:00', + 'status' => 'pending', + ]); + + $sent = $this->app->make(CalendarReminderSender::class)->sendDue(Carbon::parse('2026-09-30 10:00:00', 'Europe/Paris')); + + $this->assertSame(0, $sent); + $this->assertSame('skipped', $reminder->fresh()->status); + $this->assertSame(0, SmsCampaign::query()->count()); + } + + public function test_reminder_message_prioritizes_title_date_location_then_truncated_description_in_one_sms(): void + { + config([ + 'relais_sms.caldav.reminder_message_header' => '', + 'relais_sms.caldav.reminder_message_footer' => '', + 'relais_sms.caldav.reminder_description_max_length' => 500, + 'relais_sms.caldav.display_timezone' => 'Europe/Paris', + ]); + $event = CalendarEvent::query()->create([ + 'source' => 'caldav', + 'external_id' => 'long-message', + 'summary' => 'Reunion importante', + 'description' => str_repeat('description longue ', 30), + 'location' => 'Salle A', + 'starts_at' => '2026-06-12 14:00:00', + ]); + $reminder = new CalendarReminder; + $reminder->setRelation('event', $event); + $method = new \ReflectionMethod(CalendarReminderSender::class, 'message'); + + /** @var string $message */ + $message = $method->invoke($this->app->make(CalendarReminderSender::class), $reminder); + + $this->assertStringStartsWith("Rappel : Reunion importante\n12/06/2026 16:00\nSalle A\n", $message); + $this->assertStringEndsWith('[...]', $message); + $this->assertTrue($this->app->make(SmsMessageLength::class)->fitsInOneSms($message)); + } + + public function test_due_display_alarm_sends_one_sms_to_attendee_and_organizer(): void + { + Carbon::setTestNow(Carbon::parse('2026-06-12 15:05:00', 'Europe/Paris')); + config([ + 'relais_sms.caldav.reminder_message_header' => 'AFPMA', + 'relais_sms.caldav.reminder_message_footer' => 'A bientot', + 'relais_sms.caldav.reminder_description_max_length' => 20, + 'relais_sms.caldav.sync_interval_minutes' => 60, + ]); + + $calendarClient = new class implements CalendarClientInterface + { + public int $calls = 0; + + public function fetchEvents(CarbonInterface $from, CarbonInterface $to): array + { + $this->calls++; + + return [ + new CalendarRemoteEvent( + href: '/remote.php/dav/calendars/david/personal/event-test.ics', + etag: 'etag-1', + ical: <<<'ICS' +BEGIN:VCALENDAR +VERSION:2.0 +BEGIN:VEVENT +UID:event-test +SUMMARY:test +DESCRIPTION:Description calendrier tres longue pour le SMS. +LOCATION:Salle A +DTSTART;TZID=Europe/Paris:20260612T160000 +DTEND;TZID=Europe/Paris:20260612T170000 +ORGANIZER;CN=David Mercereau:mailto:david@example.test +ATTENDEE;CN=Marie Durand:mailto:marie@example.test +BEGIN:VALARM +ACTION:DISPLAY +TRIGGER:-PT1H +DESCRIPTION:Rappel +END:VALARM +BEGIN:VALARM +ACTION:EMAIL +TRIGGER:-PT2H +DESCRIPTION:Rappel email +END:VALARM +END:VEVENT +END:VCALENDAR +ICS, + ), + ]; + } + }; + $this->app->bind(CalendarClientInterface::class, fn (): CalendarClientInterface => $calendarClient); + + $this->app->bind(SmsProviderInterface::class, fn (): SmsProviderInterface => new class implements SmsProviderInterface + { + public function send(SmsCampaign $campaign, array $recipients): SmsSendResult + { + return new SmsSendResult( + serviceName: 'sms-test', + providerJobId: 'job-calendar', + requestPayload: ['receivers' => array_column($recipients, 'number')], + responsePayload: ['ok' => true], + providerMessageIds: ['message-calendar-1', 'message-calendar-2'], + ); + } + }); + + User::factory()->create(); + $contact = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'Marie', + 'last_name' => 'Durand', + 'email' => 'marie@example.test', + ]); + $contact->phoneNumbers()->create([ + 'raw_number' => '06 11 11 11 11', + 'normalized_number' => '+33611111111', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + $organizer = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'David', + 'last_name' => 'Mercereau', + 'email' => 'david@example.test', + ]); + $organizer->phoneNumbers()->create([ + 'raw_number' => '06 22 22 22 22', + 'normalized_number' => '+33622222222', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + $this->artisan('calendar:process-reminders')->assertExitCode(0); + $this->artisan('calendar:process-reminders')->assertExitCode(0); + + $this->assertSame(1, $calendarClient->calls, 'Le client CalDAV ne doit etre appele qu une fois dans l intervalle configure.'); + $this->assertDatabaseHas('calendar_events', [ + 'source' => 'caldav', + 'external_id' => 'event-test', + 'summary' => 'test', + ]); + $this->assertDatabaseHas('calendar_reminders', [ + 'status' => 'sent', + 'action' => 'DISPLAY', + 'trigger_minutes' => -60, + ]); + $this->assertSame(1, CalendarReminder::query()->count(), 'Un seul rappel DISPLAY doit etre programme.'); + $this->assertSame(1, SmsCampaign::query()->count(), 'Un rappel deja envoye ne doit pas recreer de campagne.'); + $this->assertDatabaseHas('sms_campaigns', [ + 'message' => "AFPMA\nRappel : test\n12/06/2026 16:00\nSalle A\nDescription calendri[...]\nA bientot", + 'status' => 'sent', + 'recipients_count' => 2, + ]); + $this->assertDatabaseHas('sms_deliveries', [ + 'number' => '+33611111111', + 'status' => 'sent', + 'provider_message_id' => 'message-calendar-1', + ]); + $this->assertDatabaseHas('sms_deliveries', [ + 'number' => '+33622222222', + 'status' => 'sent', + 'provider_message_id' => 'message-calendar-2', + ]); + } + + public function test_skipped_reminder_is_not_reactivated_after_organizer_becomes_resolvable(): void + { + Carbon::setTestNow(Carbon::parse('2026-06-12 15:05:00', 'Europe/Paris')); + config(['relais_sms.caldav.sync_interval_minutes' => 60]); + + $calendarClient = new class implements CalendarClientInterface + { + public function fetchEvents(CarbonInterface $from, CarbonInterface $to): array + { + return [ + new CalendarRemoteEvent( + href: '/calendar/organizer-only.ics', + etag: 'etag-organizer', + ical: <<<'ICS' +BEGIN:VCALENDAR +VERSION:2.0 +BEGIN:VEVENT +UID:organizer-only +SUMMARY:organizer only +DTSTART;TZID=Europe/Paris:20260612T160000 +DTEND;TZID=Europe/Paris:20260612T170000 +ORGANIZER;CN=David Mercereau:mailto:david@example.test +BEGIN:VALARM +ACTION:DISPLAY +TRIGGER:-PT1H +END:VALARM +END:VEVENT +END:VCALENDAR +ICS, + ), + ]; + } + }; + $this->app->bind(CalendarClientInterface::class, fn (): CalendarClientInterface => $calendarClient); + User::factory()->create(); + + $this->artisan('calendar:process-reminders')->assertExitCode(0); + + $this->assertDatabaseHas('calendar_reminders', ['status' => 'skipped']); + + $organizer = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'David', + 'last_name' => 'Mercereau', + 'email' => 'david@example.test', + ]); + $organizer->phoneNumbers()->create([ + 'raw_number' => '06 22 22 22 22', + 'normalized_number' => '+33622222222', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + Carbon::setTestNow(Carbon::now()->addHour()); + + $this->artisan('calendar:process-reminders --force-sync')->assertExitCode(0); + + $this->assertDatabaseHas('calendar_reminders', ['status' => 'skipped']); + $this->assertSame(0, SmsCampaign::query()->count()); + } +} diff --git a/tests/Feature/Calendar/RecurringCalendarTest.php b/tests/Feature/Calendar/RecurringCalendarTest.php new file mode 100644 index 0000000..da58e9c --- /dev/null +++ b/tests/Feature/Calendar/RecurringCalendarTest.php @@ -0,0 +1,151 @@ +mock(CalendarClientInterface::class); + $client->shouldReceive('fetchEvents')->once()->andReturn([ + new CalendarRemoteEvent('/calendar/staff.ics', 'etag', $ical), + ]); + $this->app->make(CalendarEventSyncService::class)->sync(); + } + + public function test_each_occurrence_sends_once_and_keeps_local_time_across_dst(): void + { + Carbon::setTestNow(Carbon::parse('2026-10-19 09:14:00', 'Europe/Paris')); + User::factory()->create(); + $contact = Contact::query()->create(['source' => 'local', 'first_name' => 'Test', 'last_name' => 'Contact']); + $contact->phoneNumbers()->create([ + 'raw_number' => '0611111111', 'normalized_number' => '+33611111111', + 'country' => 'FR', 'is_valid' => true, 'is_mobile' => true, 'is_primary' => true, + ]); + config(['relais_sms.caldav.default_contact_ids' => [$contact->id], 'relais_sms.caldav.display_timezone' => 'Europe/Paris']); + $this->mock(SmsProviderInterface::class)->shouldReceive('send')->twice()->andReturn( + new SmsSendResult('test', 'job', [], [], ['message']), + ); + $ical = $this->calendar('EXDATE;TZID=Europe/Paris:20261005T110000'); + $this->sync($ical); + $sender = $this->app->make(CalendarReminderSender::class); + $this->assertSame(1, $sender->sendDue()); + $this->sync($ical); + $this->assertSame(0, $sender->sendDue()); + $this->assertDatabaseHas('calendar_events', ['starts_at' => '2026-11-02 10:00:00']); + $this->assertDatabaseHas('calendar_reminders', ['remind_at' => '2026-11-02 08:00:00', 'status' => 'pending']); + + Carbon::setTestNow(Carbon::parse('2026-11-02 09:14:00', 'Europe/Paris')); + $this->sync($ical); + $this->assertSame(1, $sender->sendDue()); + $this->assertSame(2, SmsCampaign::query()->count()); + $this->assertStringContainsString('02/11/2026 11:00', SmsCampaign::query()->latest('id')->first()->message); + } + + public function test_new_exdate_and_cancelled_exception_cancel_existing_pending_reminders(): void + { + Carbon::setTestNow(Carbon::parse('2026-10-18 12:00:00', 'UTC')); + $this->sync($this->calendar()); + $october = CalendarEvent::query()->where('starts_at', '2026-10-19 09:00:00')->firstOrFail(); + $november = CalendarEvent::query()->where('starts_at', '2026-11-02 10:00:00')->firstOrFail(); + $this->sync($this->calendar('EXDATE;TZID=Europe/Paris:20261019T110000', "BEGIN:VEVENT\nUID:staff\nRECURRENCE-ID;TZID=Europe/Paris:20261102T110000\nSTATUS:CANCELLED\nEND:VEVENT")); + foreach ([$october, $november] as $event) { + $this->assertNotNull($event->fresh()->deleted_at); + $this->assertSame('cancelled', $event->reminders()->first()->status); + } + $this->mock(SmsProviderInterface::class)->shouldNotReceive('send'); + Carbon::setTestNow(Carbon::parse('2026-11-02 08:14:00', 'UTC')); + $this->assertSame(0, $this->app->make(CalendarReminderSender::class)->sendDue()); + } + + public function test_moved_occurrence_updates_one_reminder_and_keeps_identity_after_send(): void + { + Carbon::setTestNow(Carbon::parse('2026-10-18 12:00:00', 'UTC')); + $this->sync($this->calendar()); + $event = CalendarEvent::query()->where('starts_at', '2026-10-19 09:00:00')->firstOrFail(); + $reminder = $event->reminders()->firstOrFail(); + $exception = "BEGIN:VEVENT\nUID:staff\nRECURRENCE-ID;TZID=Europe/Paris:20261019T110000\nDTSTART;TZID=Europe/Paris:20261020T140000\nDTEND;TZID=Europe/Paris:20261020T150000\nSUMMARY:Point deplace\nBEGIN:VALARM\nACTION:DISPLAY\nTRIGGER:-PT2H\nEND:VALARM\nEND:VEVENT"; + $this->sync($this->calendar('', $exception)); + $this->assertSame('2026-10-20 12:00:00', $event->fresh()->getRawOriginal('starts_at')); + $this->assertSame('2026-10-20 10:00:00', $reminder->fresh()->getRawOriginal('remind_at')); + $this->assertSame(1, $event->reminders()->count()); + $reminder->update(['status' => 'sent']); + $this->sync($this->calendar('', str_replace('20261020T140000', '20261020T160000', $exception))); + $this->assertSame('sent', $reminder->fresh()->status); + $this->assertSame(1, $event->reminders()->count()); + } + + public function test_existing_sent_first_occurrence_is_preserved_when_importing_a_series(): void + { + Carbon::setTestNow(Carbon::parse('2026-10-05 07:15:00', 'UTC')); + $event = CalendarEvent::query()->create(['source' => 'caldav', 'external_id' => 'staff', 'starts_at' => '2026-10-05 09:00:00']); + $event->reminders()->create(['reminder_key' => sha1('DISPLAY|-PT2H|0'), 'status' => 'sent', 'sent_at' => Carbon::now(), 'remind_at' => '2026-10-05 07:00:00']); + $this->sync($this->calendar()); + $this->assertSame(4, CalendarEvent::query()->count()); + $this->assertSame('sent', $event->reminders()->first()->status); + $this->assertStringStartsWith('recurrence:', $event->fresh()->external_id); + $this->assertSame(1, CalendarReminder::query()->where('status', 'sent')->count()); + } + + public function test_cancelled_series_can_be_restored_and_expired_reminders_are_not_sent(): void + { + Carbon::setTestNow(Carbon::parse('2026-10-19 09:36:00', 'UTC')); + $this->mock(SmsProviderInterface::class)->shouldNotReceive('send'); + $this->sync($this->calendar()); + $event = CalendarEvent::query()->where('starts_at', '2026-10-19 09:00:00')->firstOrFail(); + $this->assertSame(0, $this->app->make(CalendarReminderSender::class)->sendDue()); + $this->assertSame('skipped', $event->reminders()->first()->status); + $future = CalendarEvent::query()->where('starts_at', '2026-11-02 10:00:00')->firstOrFail(); + $this->sync($this->calendar('STATUS:CANCELLED')); + $this->assertSame('cancelled', $future->reminders()->first()->status); + $this->sync($this->calendar()); + $this->assertNull($future->fresh()->deleted_at); + $this->assertSame('pending', $future->reminders()->first()->status); + $this->assertSame('skipped', $event->reminders()->first()->status); + } + + public function test_monthly_count_until_and_additional_dates_are_bounded(): void + { + $parser = new ICalendarParser; + $from = Carbon::parse('2026-10-01', 'UTC'); + $to = Carbon::parse('2027-02-01', 'UTC'); + $ical = str_replace('FREQ=WEEKLY;INTERVAL=2;BYDAY=MO;COUNT=4', 'FREQ=MONTHLY;BYDAY=1MO;COUNT=3', $this->calendar()); + $events = $parser->parse($ical, $from, $to); + $this->assertSame(['2026-10-05 09:00:00', '2026-11-02 10:00:00', '2026-12-07 10:00:00'], array_map(fn ($e) => $e->startsAt->format('Y-m-d H:i:s'), $events)); + $ical = str_replace('COUNT=3', 'UNTIL=20261102T100000Z', $ical); + $this->assertCount(2, $parser->parse($ical, $from, $to)); + $combined = str_replace('BEGIN:VALARM', "RDATE;TZID=Europe/Paris:20261019T110000,20261102T110000\nBEGIN:VALARM", $ical); + $this->assertCount(3, $parser->parse($combined, $from, $to)); + $ical = str_replace('RRULE:FREQ=MONTHLY;BYDAY=1MO;UNTIL=20261102T100000Z', 'RDATE;TZID=Europe/Paris:20261019T110000,20261102T110000', $ical); + $this->assertCount(3, $parser->parse($ical, $from, $to)); + } +} diff --git a/tests/Feature/CardDav/CardDavContactSyncServiceTest.php b/tests/Feature/CardDav/CardDavContactSyncServiceTest.php new file mode 100644 index 0000000..5b76c2d --- /dev/null +++ b/tests/Feature/CardDav/CardDavContactSyncServiceTest.php @@ -0,0 +1,109 @@ +create([ + 'source' => 'local', + 'name' => 'Equipe locale', + 'slug' => 'equipe-locale', + ]); + + $existingContact = Contact::query()->create([ + 'source' => 'carddav', + 'external_id' => 'uid-marie', + 'first_name' => 'Ancien', + 'last_name' => 'Nom', + 'sms_opt_out' => true, + 'is_favorite' => true, + ]); + $existingContact->groups()->attach($localGroup); + $existingContact->phoneNumbers()->create([ + 'raw_number' => '04 00 00 00 00', + 'is_primary' => true, + ]); + + $missingContact = Contact::query()->create([ + 'source' => 'carddav', + 'external_id' => 'uid-missing', + 'last_name' => 'Disparu', + ]); + + $this->app->bind(CardDavClientInterface::class, fn (): CardDavClientInterface => new class implements CardDavClientInterface + { + public function fetchCards(): array + { + return [ + new CardDavRemoteCard( + href: '/remote.php/dav/addressbooks/users/david/contacts/marie.vcf', + etag: 'etag-1', + vcard: <<<'VCF' +BEGIN:VCARD +VERSION:3.0 +UID:uid-marie +FN:Marie Durand +N:Durand;Marie;;; +EMAIL:marie@example.test +TEL;TYPE=CELL:064-201-4207 +CATEGORIES:Benevoles,Conseil +END:VCARD +VCF, + ), + ]; + } + }); + + $run = $this->app->make(CardDavContactSyncService::class)->sync(); + + $this->assertSame('success', $run->status); + $this->assertSame(1, $run->fetched_contacts); + $this->assertSame(1, $run->synced_contacts); + $this->assertSame(1, $run->deleted_contacts); + + $this->assertDatabaseHas('contacts', [ + 'id' => $existingContact->id, + 'source' => 'carddav', + 'external_id' => 'uid-marie', + 'remote_etag' => 'etag-1', + 'first_name' => 'Marie', + 'last_name' => 'Durand', + 'email' => 'marie@example.test', + 'sms_opt_out' => true, + 'is_favorite' => true, + ]); + $this->assertSoftDeleted('contacts', [ + 'id' => $missingContact->id, + ]); + $this->assertDatabaseHas('contact_phone_numbers', [ + 'contact_id' => $existingContact->id, + 'raw_number' => '064-201-4207', + 'normalized_number' => '+33642014207', + 'is_valid' => true, + 'is_mobile' => true, + ]); + $this->assertDatabaseHas('contact_groups', [ + 'source' => 'carddav', + 'external_id' => 'benevoles', + 'name' => 'Benevoles', + ]); + $this->assertDatabaseHas('contact_contact_group', [ + 'contact_id' => $existingContact->id, + 'contact_group_id' => $localGroup->id, + ]); + $this->assertSame(1, SourceSyncRun::query()->where('source', 'carddav')->where('status', 'success')->count()); + } +} diff --git a/tests/Feature/ContactManagementTest.php b/tests/Feature/ContactManagementTest.php new file mode 100644 index 0000000..7c59825 --- /dev/null +++ b/tests/Feature/ContactManagementTest.php @@ -0,0 +1,440 @@ +create(); + + $this->actingAs($user) + ->post('/contact-groups', [ + 'name' => 'Benevoles', + 'description' => 'Equipe locale', + 'is_favorite' => '1', + ]) + ->assertRedirect('/contacts'); + + $group = ContactGroup::query()->where('name', 'Benevoles')->firstOrFail(); + + $response = $this->actingAs($user) + ->post('/contacts', [ + 'first_name' => 'Marie', + 'last_name' => 'Durand', + 'organization' => 'AFPMA', + 'email' => 'marie@example.test', + 'raw_phone_number' => '06 11 11 00 03', + 'phone_label' => 'Mobile', + 'group_ids' => [$group->id], + 'sms_opt_out' => '1', + 'is_favorite' => '1', + ]); + + $contact = Contact::query()->where('email', 'marie@example.test')->firstOrFail(); + + $response->assertRedirect(route('contacts.show', $contact)); + + $this->assertDatabaseHas('contacts', [ + 'id' => $contact->id, + 'source' => 'local', + 'sms_opt_out' => true, + 'is_favorite' => true, + ]); + + $this->assertDatabaseHas('contact_contact_group', [ + 'contact_id' => $contact->id, + 'contact_group_id' => $group->id, + ]); + + $this->assertDatabaseHas('contact_phone_numbers', [ + 'contact_id' => $contact->id, + 'raw_number' => '06 11 11 00 03', + 'normalized_number' => '+33611110003', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + ]); + } + + public function test_contacts_can_be_searched_by_name_and_phone_number(): void + { + $user = User::factory()->create(); + $contact = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'Jean', + 'last_name' => 'Martin', + 'email' => 'jean@example.test', + ]); + + $contact->phoneNumbers()->create([ + 'raw_number' => '06 11 11 00 01', + 'normalized_number' => '+33611110001', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + $this->actingAs($user) + ->get('/contacts?q=Martin') + ->assertOk() + ->assertSee('Jean Martin') + ->assertSee('+33611110001'); + + $this->actingAs($user) + ->get('/contacts?q=11110001') + ->assertOk() + ->assertSee('Jean Martin'); + } + + public function test_contacts_default_mobile_filter_includes_stale_normalized_mobile_numbers(): void + { + $user = User::factory()->create(); + $contact = Contact::query()->create([ + 'source' => 'carddav', + 'external_id' => 'uid-yveline', + 'first_name' => 'Yveline', + 'last_name' => 'Mobile', + ]); + $contact->phoneNumbers()->create([ + 'raw_number' => '064-201-4207', + 'normalized_number' => '+33642014207', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => false, + 'is_primary' => true, + ]); + + $this->actingAs($user) + ->get('/contacts') + ->assertOk() + ->assertSee('Yveline Mobile') + ->assertSee('Mobile detecte'); + } + + public function test_authenticated_user_can_update_contact(): void + { + $user = User::factory()->create(); + $oldGroup = ContactGroup::query()->create([ + 'source' => 'local', + 'name' => 'Anciens', + 'slug' => 'anciens', + ]); + $newGroup = ContactGroup::query()->create([ + 'source' => 'local', + 'name' => 'Membres', + 'slug' => 'membres', + ]); + $contact = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'Jean', + 'last_name' => 'Martin', + 'email' => 'jean@example.test', + ]); + $contact->groups()->attach($oldGroup); + $contact->phoneNumbers()->create([ + 'label' => 'Mobile', + 'raw_number' => '06 11 11 00 01', + 'normalized_number' => '+33611110001', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + $this->actingAs($user) + ->put(route('contacts.update', $contact), [ + 'first_name' => 'Jeanne', + 'last_name' => 'Martin', + 'email' => 'jeanne@example.test', + 'raw_phone_number' => '07 55 55 00 04', + 'phone_label' => 'Portable', + 'group_ids' => [$newGroup->id], + 'is_favorite' => '1', + ]) + ->assertRedirect(route('contacts.show', $contact)); + + $this->assertDatabaseHas('contacts', [ + 'id' => $contact->id, + 'first_name' => 'Jeanne', + 'email' => 'jeanne@example.test', + 'sms_opt_out' => false, + 'is_favorite' => true, + ]); + + $this->assertDatabaseMissing('contact_contact_group', [ + 'contact_id' => $contact->id, + 'contact_group_id' => $oldGroup->id, + ]); + $this->assertDatabaseHas('contact_contact_group', [ + 'contact_id' => $contact->id, + 'contact_group_id' => $newGroup->id, + ]); + $this->assertDatabaseHas('contact_phone_numbers', [ + 'contact_id' => $contact->id, + 'label' => 'Portable', + 'raw_number' => '07 55 55 00 04', + 'normalized_number' => '+33755550004', + 'is_mobile' => true, + ]); + } + + public function test_imported_contacts_cannot_be_edited_or_deleted(): void + { + $user = User::factory()->create(); + $contact = Contact::query()->create([ + 'source' => 'carddav', + 'external_id' => 'remote-1', + 'first_name' => 'Jean', + 'last_name' => 'Importe', + ]); + + $this->actingAs($user) + ->get(route('contacts.edit', $contact)) + ->assertForbidden(); + + $this->actingAs($user) + ->put(route('contacts.update', $contact), [ + 'last_name' => 'Modifie', + ]) + ->assertForbidden(); + + $this->actingAs($user) + ->delete(route('contacts.destroy', $contact)) + ->assertForbidden(); + + $this->assertDatabaseHas('contacts', [ + 'id' => $contact->id, + 'last_name' => 'Importe', + 'deleted_at' => null, + ]); + } + + public function test_authenticated_user_can_toggle_favorite_on_imported_contact(): void + { + $user = User::factory()->create(); + $contact = Contact::query()->create([ + 'source' => 'carddav', + 'external_id' => 'remote-favorite', + 'first_name' => 'Yveline', + 'last_name' => 'Importee', + 'is_favorite' => false, + ]); + + $this->actingAs($user) + ->patch(route('contacts.favorite', $contact), [ + 'is_favorite' => '1', + ]) + ->assertRedirect(); + + $this->assertDatabaseHas('contacts', [ + 'id' => $contact->id, + 'source' => 'carddav', + 'is_favorite' => true, + ]); + + $this->actingAs($user) + ->patch(route('contacts.favorite', $contact), [ + 'is_favorite' => '0', + ]) + ->assertRedirect(); + + $this->assertDatabaseHas('contacts', [ + 'id' => $contact->id, + 'source' => 'carddav', + 'is_favorite' => false, + ]); + } + + public function test_authenticated_user_can_toggle_sms_opt_out_on_imported_contact(): void + { + $user = User::factory()->create(); + $contact = Contact::query()->create([ + 'source' => 'galette', + 'external_id' => 'remote-opt-out', + 'first_name' => 'Claire', + 'last_name' => 'Importee', + 'sms_opt_out' => false, + ]); + + $this->actingAs($user) + ->patch(route('contacts.opt-out', $contact), [ + 'sms_opt_out' => '1', + ]) + ->assertRedirect(); + + $this->assertDatabaseHas('contacts', [ + 'id' => $contact->id, + 'source' => 'galette', + 'sms_opt_out' => true, + ]); + + $this->actingAs($user) + ->patch(route('contacts.opt-out', $contact), [ + 'sms_opt_out' => '0', + ]) + ->assertRedirect(); + + $this->assertDatabaseHas('contacts', [ + 'id' => $contact->id, + 'source' => 'galette', + 'sms_opt_out' => false, + ]); + } + + public function test_authenticated_user_can_delete_contact(): void + { + $user = User::factory()->create(); + $contact = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'Jean', + 'last_name' => 'Martin', + ]); + + $this->actingAs($user) + ->delete(route('contacts.destroy', $contact)) + ->assertRedirect(route('contacts.index')); + + $this->assertSoftDeleted('contacts', [ + 'id' => $contact->id, + ]); + } + + public function test_authenticated_user_can_update_and_delete_group(): void + { + $user = User::factory()->create(); + $group = ContactGroup::query()->create([ + 'source' => 'local', + 'name' => 'Benevoles', + 'slug' => 'benevoles', + ]); + $contact = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'Marie', + 'last_name' => 'Durand', + ]); + $contact->groups()->attach($group); + + $this->actingAs($user) + ->put(route('contact-groups.update', $group), [ + 'name' => 'Equipe accueil', + 'description' => 'Permanences', + 'is_favorite' => '1', + ]) + ->assertRedirect(route('contacts.index', ['group' => $group->id])); + + $this->assertDatabaseHas('contact_groups', [ + 'id' => $group->id, + 'name' => 'Equipe accueil', + 'slug' => 'equipe-accueil', + 'description' => 'Permanences', + 'is_favorite' => true, + ]); + + $this->actingAs($user) + ->delete(route('contact-groups.destroy', $group)) + ->assertRedirect(route('contacts.index')); + + $this->assertSoftDeleted('contact_groups', [ + 'id' => $group->id, + ]); + $this->assertDatabaseMissing('contact_contact_group', [ + 'contact_id' => $contact->id, + 'contact_group_id' => $group->id, + ]); + } + + public function test_authenticated_user_can_update_local_group_members(): void + { + $user = User::factory()->create(); + $group = ContactGroup::query()->create([ + 'source' => 'local', + 'name' => 'Benevoles', + 'slug' => 'benevoles', + ]); + $kept = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'Marie', + 'last_name' => 'Durand', + ]); + $removed = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'Paul', + 'last_name' => 'Ancien', + ]); + $addedImported = Contact::query()->create([ + 'source' => 'carddav', + 'external_id' => 'remote-added', + 'first_name' => 'Claire', + 'last_name' => 'Importee', + ]); + $group->contacts()->attach([$kept->id, $removed->id]); + + $this->actingAs($user) + ->put(route('contact-groups.update', $group), [ + 'name' => 'Benevoles', + 'members_submitted' => '1', + 'contact_ids' => [$kept->id, $addedImported->id], + ]) + ->assertRedirect(route('contacts.index', ['group' => $group->id])); + + $this->assertDatabaseHas('contact_contact_group', [ + 'contact_id' => $kept->id, + 'contact_group_id' => $group->id, + ]); + $this->assertDatabaseHas('contact_contact_group', [ + 'contact_id' => $addedImported->id, + 'contact_group_id' => $group->id, + ]); + $this->assertDatabaseMissing('contact_contact_group', [ + 'contact_id' => $removed->id, + 'contact_group_id' => $group->id, + ]); + } + + public function test_imported_groups_cannot_be_edited_or_deleted(): void + { + $user = User::factory()->create(); + $group = ContactGroup::query()->create([ + 'source' => 'galette', + 'external_id' => 'remote-group', + 'name' => 'Groupe importe', + 'slug' => 'galette-groupe-importe', + ]); + + $this->actingAs($user) + ->get(route('contact-groups.edit', $group)) + ->assertForbidden(); + + $this->actingAs($user) + ->put(route('contact-groups.update', $group), [ + 'name' => 'Modifie', + ]) + ->assertForbidden(); + + $this->actingAs($user) + ->delete(route('contact-groups.destroy', $group)) + ->assertForbidden(); + + $this->assertDatabaseHas('contact_groups', [ + 'id' => $group->id, + 'name' => 'Groupe importe', + 'deleted_at' => null, + ]); + } + + public function test_guest_cannot_access_contacts(): void + { + $this->get('/contacts') + ->assertRedirect('/login'); + } +} diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php new file mode 100644 index 0000000..0e627b2 --- /dev/null +++ b/tests/Feature/ExampleTest.php @@ -0,0 +1,114 @@ +get('/') + ->assertRedirect('/recipients'); + } + + public function test_guests_are_redirected_to_login(): void + { + $this->get('/recipients') + ->assertRedirect('/login'); + } + + public function test_login_page_is_available(): void + { + $this->get('/login') + ->assertOk() + ->assertSee('Connexion'); + } + + public function test_authenticated_user_can_access_recipient_selection(): void + { + $user = User::factory()->create(); + + $this->actingAs($user) + ->get('/recipients') + ->assertOk() + ->assertSee('Composer') + ->assertSee('Pour'); + } + + public function test_user_can_log_in_and_log_out(): void + { + User::factory()->create([ + 'email' => 'admin@relais-sms.test', + 'password' => 'relais-sms', + ]); + + $this->post('/login', [ + 'email' => 'admin@relais-sms.test', + 'password' => 'relais-sms', + ])->assertRedirect('/recipients'); + + $this->assertAuthenticated(); + + $this->post('/logout') + ->assertRedirect('/login'); + + $this->assertGuest(); + } + + public function test_default_app_settings_are_seeded(): void + { + config(['relais_sms.default_settings.max_sms_per_campaign' => 100]); + $this->seed(); + + $this->assertDatabaseHas('app_settings', [ + 'key' => 'max_sms_per_campaign', + 'value' => '100', + 'type' => 'integer', + ]); + } + + public function test_production_seeding_rejects_default_admin_password(): void + { + $this->app['env'] = 'production'; + $repository = Env::getRepository(); + $originalPassword = $repository->get('RELAIS_SMS_ADMIN_PASSWORD'); + $repository->set('RELAIS_SMS_ADMIN_PASSWORD', 'relais-sms'); + + try { + $this->expectException(RuntimeException::class); + (new DatabaseSeeder)->run(); + } finally { + $originalPassword === null + ? $repository->clear('RELAIS_SMS_ADMIN_PASSWORD') + : $repository->set('RELAIS_SMS_ADMIN_PASSWORD', $originalPassword); + } + } + + public function test_production_seeding_accepts_a_personal_admin_password(): void + { + $this->app['env'] = 'production'; + $repository = Env::getRepository(); + $originalPassword = $repository->get('RELAIS_SMS_ADMIN_PASSWORD'); + $repository->set('RELAIS_SMS_ADMIN_PASSWORD', 'test-only-personal-password'); + + try { + (new DatabaseSeeder)->run(); + + $user = User::query()->sole(); + $this->assertTrue(Hash::check('test-only-personal-password', $user->password)); + } finally { + $originalPassword === null + ? $repository->clear('RELAIS_SMS_ADMIN_PASSWORD') + : $repository->set('RELAIS_SMS_ADMIN_PASSWORD', $originalPassword); + } + } +} diff --git a/tests/Feature/OvhSmsProviderTest.php b/tests/Feature/OvhSmsProviderTest.php new file mode 100644 index 0000000..bf5cfe7 --- /dev/null +++ b/tests/Feature/OvhSmsProviderTest.php @@ -0,0 +1,87 @@ + 'test', + 'relais_sms.ovh.application_secret' => 'test', + 'relais_sms.ovh.consumer_key' => 'test', + 'relais_sms.ovh.sms_service_name' => 'sms-test', + 'relais_sms.ovh.sms_sender' => '', + 'relais_sms.ovh.sms_short_code' => true, + 'relais_sms.ovh.endpoint' => 'ovh-eu', + ]); + } + + public function test_short_code_strips_links_from_the_actual_signed_request(): void + { + $history = []; + $stack = HandlerStack::create(new MockHandler([new Response(200, [], '123456'), new Response(200, [], '{"ids":["1"]}')])); + $stack->push(Middleware::history($history)); + $provider = new OvhSmsProvider(new Client(['handler' => $stack])); + $result = $provider->send(new SmsCampaign(['message' => 'Reunion https://zoom.us/j/123 à 10h']), [['number' => '+33611111111']]); + + $payload = json_decode((string) $history[1]['request']->getBody(), true); + $this->assertSame('Reunion à 10h', $payload['message']); + $this->assertTrue($payload['senderForResponse']); + $this->assertArrayNotHasKey('sender', $payload); + $this->assertSame($payload, $result->requestPayload); + } + + public function test_named_sender_preserves_links_and_does_not_request_a_short_code(): void + { + config(['relais_sms.ovh.sms_short_code' => false, 'relais_sms.ovh.sms_sender' => 'AFPMA']); + $provider = new OvhSmsProvider(new Client(['handler' => HandlerStack::create(new MockHandler([new Response(200, [], '123456'), new Response(200, [], '{"ids":["1"]}')]))])); + $result = $provider->send(new SmsCampaign(['message' => 'Reunion https://zoom.us/j/123']), [['number' => '+33611111111']]); + + $this->assertSame('Reunion https://zoom.us/j/123', $result->requestPayload['message']); + $this->assertSame('AFPMA', $result->requestPayload['sender']); + $this->assertArrayNotHasKey('senderForResponse', $result->requestPayload); + } + + public function test_link_only_message_is_rejected_before_any_network_request(): void + { + $this->expectException(SmsProviderException::class); + $this->expectExceptionMessage('vide apres retrait'); + (new OvhSmsProvider(new Client(['handler' => HandlerStack::create(new MockHandler([]))])))->send(new SmsCampaign(['message' => 'https://zoom.us/j/123']), []); + } + + public function test_disabling_short_code_requires_an_explicit_sender(): void + { + config(['relais_sms.ovh.sms_short_code' => false]); + $this->expectException(SmsProviderException::class); + $this->expectExceptionMessage('Configurer OVH_SMS_SENDER'); + (new OvhSmsProvider(new Client(['handler' => HandlerStack::create(new MockHandler([]))])))->send(new SmsCampaign(['message' => 'Rappel']), []); + } + + public function test_conflicting_sender_configuration_is_rejected(): void + { + config(['relais_sms.ovh.sms_sender' => 'AFPMA']); + $this->expectException(SmsProviderException::class); + $this->expectExceptionMessage('incompatible'); + (new OvhSmsProvider(new Client(['handler' => HandlerStack::create(new MockHandler([]))])))->send(new SmsCampaign(['message' => 'Rappel']), []); + } + + public function test_unknown_endpoint_is_not_silently_routed_to_ovh_europe(): void + { + config(['relais_sms.ovh.endpoint' => 'another-provider']); + $this->expectException(SmsProviderException::class); + $this->expectExceptionMessage('Endpoint OVH non pris en charge'); + (new OvhSmsProvider(new Client(['handler' => HandlerStack::create(new MockHandler([]))])))->send(new SmsCampaign(['message' => 'Rappel']), []); + } +} diff --git a/tests/Feature/OvhStopCallbackTest.php b/tests/Feature/OvhStopCallbackTest.php new file mode 100644 index 0000000..64a275a --- /dev/null +++ b/tests/Feature/OvhStopCallbackTest.php @@ -0,0 +1,108 @@ + 'secret-token']); + + $cardDavContact = Contact::query()->create([ + 'source' => 'carddav', + 'external_id' => 'remote-carddav', + 'last_name' => 'CardDAV', + ]); + $cardDavContact->phoneNumbers()->create([ + 'raw_number' => '06 11 11 11 11', + 'normalized_number' => '+33611111111', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + $galetteContact = Contact::query()->create([ + 'source' => 'galette', + 'external_id' => 'remote-galette', + 'last_name' => 'Galette', + ]); + $galetteContact->phoneNumbers()->create([ + 'raw_number' => '06 11 11 11 11', + 'normalized_number' => '+33611111111', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + $this->postJson(route('ovh.sms.stop-callback', ['token' => 'secret-token']), [ + 'sender' => '06 11 11 11 11', + 'message' => 'STOP', + ]) + ->assertOk() + ->assertJson([ + 'status' => 'ok', + 'sender' => '+33611111111', + 'updated_contacts' => 2, + 'already_opted_out_contacts' => 0, + ]); + + $this->assertDatabaseHas('contacts', [ + 'id' => $cardDavContact->id, + 'sms_opt_out' => true, + ]); + $this->assertDatabaseHas('contacts', [ + 'id' => $galetteContact->id, + 'sms_opt_out' => true, + ]); + } + + public function test_ovh_stop_callback_requires_configured_token(): void + { + config(['relais_sms.ovh.stop_callback_token' => 'secret-token']); + + $this->postJson(route('ovh.sms.stop-callback', ['token' => 'bad-token']), [ + 'sender' => '06 11 11 11 11', + ])->assertForbidden(); + } + + public function test_ovh_stop_callback_accepts_sender_in_query_string(): void + { + config(['relais_sms.ovh.stop_callback_token' => 'secret-token']); + + $contact = Contact::query()->create([ + 'source' => 'local', + 'last_name' => 'Local', + ]); + $contact->phoneNumbers()->create([ + 'raw_number' => '07 55 55 00 04', + 'normalized_number' => '+33755550004', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + $this->getJson(route('ovh.sms.stop-callback', [ + 'token' => 'secret-token', + 'sender' => '+33755550004', + ])) + ->assertOk() + ->assertJson([ + 'status' => 'ok', + 'updated_contacts' => 1, + ]); + + $this->assertDatabaseHas('contacts', [ + 'id' => $contact->id, + 'sms_opt_out' => true, + ]); + } +} diff --git a/tests/Feature/RecipientSelectionTest.php b/tests/Feature/RecipientSelectionTest.php new file mode 100644 index 0000000..6d6823b --- /dev/null +++ b/tests/Feature/RecipientSelectionTest.php @@ -0,0 +1,216 @@ +create([ + 'source' => 'local', + 'name' => 'Benevoles', + 'slug' => 'benevoles', + ]); + + $first = $this->createContact('Alice', 'Alpha'); + $duplicate = $this->createContact('Bob', 'Beta'); + $optOut = $this->createContact('Claire', 'Refus', smsOptOut: true); + $fixed = $this->createContact('Denis', 'Fixe'); + $invalid = $this->createContact('Eva', 'Invalide'); + $missing = $this->createContact('Fatima', 'Sansphone'); + + $group->contacts()->attach([$first->id, $optOut->id, $fixed->id, $invalid->id, $missing->id]); + + $first->phoneNumbers()->create([ + 'raw_number' => '06 11 11 11 11', + 'normalized_number' => '+33611111111', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + $duplicate->phoneNumbers()->create([ + 'raw_number' => '+33 6 11 11 11 11', + 'normalized_number' => '+33611111111', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + $optOut->phoneNumbers()->create([ + 'raw_number' => '06 22 22 22 22', + 'normalized_number' => '+33622222222', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + $fixed->phoneNumbers()->create([ + 'raw_number' => '01 44 44 44 44', + 'normalized_number' => '+33144444444', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => false, + 'is_primary' => true, + ]); + $invalid->phoneNumbers()->create([ + 'raw_number' => '123', + 'normalized_number' => null, + 'country' => 'FR', + 'is_valid' => false, + 'is_mobile' => false, + 'is_primary' => true, + 'validation_error' => 'Numero invalide.', + ]); + + $result = app(RecipientResolver::class)->resolve([$duplicate->id], [$group->id]); + $summary = $result->summary(); + + $this->assertSame(1, $summary['ready_numbers']); + $this->assertSame('+33611111111', $result->recipients[0]['number']); + $this->assertSame(1, $summary['duplicate']); + $this->assertSame(1, $summary['opt_out']); + $this->assertSame(1, $summary['non_mobile']); + $this->assertSame(1, $summary['invalid']); + $this->assertSame(1, $summary['missing_phone']); + } + + public function test_resolver_trusts_normalized_mobile_flag_instead_of_raw_regex(): void + { + config(['relais_sms.default_settings.mobile_phone_regex' => '/^never-matches$/']); + + $contact = $this->createContact('Alice', 'Mobile'); + $contact->phoneNumbers()->create([ + 'raw_number' => '06 11 11 11 11', + 'normalized_number' => '+33611111111', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + $result = app(RecipientResolver::class)->resolve([$contact->id], []); + + $this->assertSame(1, $result->summary()['ready_numbers']); + $this->assertSame([], $result->excluded); + } + + public function test_resolver_accepts_stale_rows_when_normalized_number_is_a_french_mobile(): void + { + $contact = $this->createContact('Yveline', 'Mobile'); + $contact->phoneNumbers()->create([ + 'raw_number' => '064-201-4207', + 'normalized_number' => '+33642014207', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => false, + 'is_primary' => true, + ]); + + $result = app(RecipientResolver::class)->resolve([$contact->id], []); + + $this->assertSame(1, $result->summary()['ready_numbers']); + $this->assertSame('+33642014207', $result->recipients[0]['number']); + $this->assertSame([], $result->excluded); + } + + public function test_authenticated_user_can_preview_recipient_selection(): void + { + $user = User::factory()->create(); + $group = ContactGroup::query()->create([ + 'source' => 'local', + 'name' => 'Membres', + 'slug' => 'membres', + ]); + $contact = $this->createContact('Marie', 'Durand'); + $contact->groups()->attach($group); + $contact->phoneNumbers()->create([ + 'raw_number' => '07 55 55 00 04', + 'normalized_number' => '+33755550004', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + $this->actingAs($user) + ->get('/recipients') + ->assertOk() + ->assertSee('Composer') + ->assertSee('Pour'); + + $this->actingAs($user) + ->getJson('/recipients/search?q=Durand') + ->assertOk() + ->assertJsonFragment([ + 'type' => 'contact', + 'label' => 'Marie Durand', + ]); + + $this->actingAs($user) + ->getJson('/recipients/search?q=Membres') + ->assertOk() + ->assertJsonFragment([ + 'type' => 'group', + 'label' => 'Membres', + ]); + + $this->actingAs($user) + ->post('/recipients/preview', [ + 'group_ids' => [$group->id], + 'contact_ids' => [$contact->id], + ]) + ->assertOk() + ->assertSee('Liste finale') + ->assertSee('+33755550004') + ->assertSee('Numeros prets'); + } + + public function test_composer_shows_configured_sms_header_footer_and_complete_message(): void + { + AppSetting::putString('sms_message_header', 'AFPMA'); + AppSetting::putString('sms_message_footer', 'Envoyer STOP SMS pour ne plus etre contacte.'); + + $user = User::factory()->create(); + $contact = $this->createContact('Marie', 'Durand'); + $contact->phoneNumbers()->create([ + 'raw_number' => '07 55 55 00 04', + 'normalized_number' => '+33755550004', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + $this->actingAs($user) + ->post('/recipients/preview', [ + 'contact_ids' => [$contact->id], + 'message' => 'Bonjour', + 'include_sms_header' => '1', + 'include_sms_footer' => '1', + ]) + ->assertOk() + ->assertSee('SMS complet') + ->assertSee("AFPMA\nBonjour\nEnvoyer STOP SMS pour ne plus etre contacte."); + } + + private function createContact(string $firstName, string $lastName, bool $smsOptOut = false): Contact + { + return Contact::query()->create([ + 'source' => 'local', + 'first_name' => $firstName, + 'last_name' => $lastName, + 'sms_opt_out' => $smsOptOut, + ]); + } +} diff --git a/tests/Feature/SettingsTest.php b/tests/Feature/SettingsTest.php new file mode 100644 index 0000000..cf51679 --- /dev/null +++ b/tests/Feature/SettingsTest.php @@ -0,0 +1,42 @@ +create(); + + $this->actingAs($user) + ->get(route('settings.edit')) + ->assertOk() + ->assertSee('Parametres') + ->assertSee('Entete de message') + ->assertSee('Pied de message'); + + $this->actingAs($user) + ->put(route('settings.update'), [ + 'sms_message_header' => 'AFPMA', + 'sms_message_footer' => 'Envoyer STOP SMS pour ne plus etre contacte.', + ]) + ->assertRedirect(route('settings.edit')); + + $this->assertDatabaseHas('app_settings', [ + 'key' => 'sms_message_header', + 'value' => 'AFPMA', + 'type' => 'string', + ]); + $this->assertDatabaseHas('app_settings', [ + 'key' => 'sms_message_footer', + 'value' => 'Envoyer STOP SMS pour ne plus etre contacte.', + 'type' => 'string', + ]); + } +} diff --git a/tests/Feature/SmsCampaignHistoryTest.php b/tests/Feature/SmsCampaignHistoryTest.php new file mode 100644 index 0000000..6c56306 --- /dev/null +++ b/tests/Feature/SmsCampaignHistoryTest.php @@ -0,0 +1,128 @@ +create(['name' => 'Alice Admin']); + $otherUser = User::factory()->create(['name' => 'Bob Admin']); + $group = ContactGroup::query()->create([ + 'source' => 'local', + 'name' => 'Benevoles', + 'slug' => 'benevoles', + ]); + + $matchingCampaign = $this->createCampaign($user, [ + 'message' => 'Message filtre', + 'status' => 'sent', + 'selected_group_ids' => [$group->id], + 'selected_group_names' => [$group->name], + ]); + + $this->createCampaign($otherUser, [ + 'message' => 'Message hors filtre', + 'status' => 'failed', + ])->forceFill([ + 'created_at' => now()->subDays(10), + ])->save(); + + $this->actingAs($user) + ->get(route('sms-campaigns.index', [ + 'from' => now()->subDay()->toDateString(), + 'to' => now()->addDay()->toDateString(), + 'status' => 'sent', + 'user_id' => $user->id, + 'group_id' => $group->id, + ])) + ->assertOk() + ->assertSee($matchingCampaign->message) + ->assertSee('Benevoles') + ->assertDontSee('Message hors filtre'); + } + + public function test_history_export_uses_current_filters(): void + { + $user = User::factory()->create(); + $group = ContactGroup::query()->create([ + 'source' => 'local', + 'name' => 'Membres', + 'slug' => 'membres', + ]); + + $this->createCampaign($user, [ + 'message' => 'Message exporte', + 'status' => 'sent', + 'selected_group_ids' => [$group->id], + 'selected_group_names' => [$group->name], + ]); + + $this->createCampaign($user, [ + 'message' => 'Message ignore', + 'status' => 'sent', + ]); + + $response = $this->actingAs($user) + ->get(route('sms-campaigns.export', ['group_id' => $group->id])) + ->assertOk(); + + $csv = $response->streamedContent(); + + $this->assertStringContainsString('Message exporte', $csv); + $this->assertStringContainsString('Membres', $csv); + $this->assertStringNotContainsString('Message ignore', $csv); + } + + public function test_expired_sms_history_can_be_pruned(): void + { + config(['relais_sms.default_settings.history_retention_years' => 3]); + + $user = User::factory()->create(); + $expired = $this->createCampaign($user, ['message' => 'Ancienne campagne']) + ->forceFill(['created_at' => now()->subYears(4)]); + $expired->save(); + $recent = $this->createCampaign($user, ['message' => 'Campagne recente']); + + $this->artisan('sms-campaigns:prune-history') + ->assertExitCode(0); + + $this->assertDatabaseMissing('sms_campaigns', ['id' => $expired->id]); + $this->assertDatabaseHas('sms_campaigns', ['id' => $recent->id]); + } + + /** + * @param array $attributes + */ + private function createCampaign(User $user, array $attributes = []): SmsCampaign + { + $campaign = SmsCampaign::query()->create(array_merge([ + 'user_id' => $user->id, + 'provider' => 'ovh', + 'status' => 'sent', + 'message' => 'Message', + 'recipients_count' => 1, + 'sent_count' => 1, + 'failed_count' => 0, + 'sent_at' => now(), + ], $attributes)); + + $campaign->deliveries()->create([ + 'contact_name' => 'Marie Durand', + 'number' => '+33611111111', + 'status' => 'sent', + 'provider_message_id' => 'message-123', + 'sent_at' => now(), + ]); + + return $campaign; + } +} diff --git a/tests/Feature/SmsCampaignReconciliationTest.php b/tests/Feature/SmsCampaignReconciliationTest.php new file mode 100644 index 0000000..c423842 --- /dev/null +++ b/tests/Feature/SmsCampaignReconciliationTest.php @@ -0,0 +1,180 @@ + 'test', + 'relais_sms.ovh.application_secret' => 'test', + 'relais_sms.ovh.consumer_key' => 'test', + 'relais_sms.ovh.sms_service_name' => 'sms-test', + 'relais_sms.ovh.sms_sender' => 'AFPMA', + 'relais_sms.ovh.sms_short_code' => false, + 'relais_sms.ovh.send_timeout' => 60, + ]); + } + + public function test_timeout_for_107_recipients_is_uncertain_and_is_never_retried(): void + { + $history = []; + $stack = HandlerStack::create(new MockHandler([ + new Response(200, [], (string) time()), + new ConnectException('cURL error 28: Operation timed out', new Request('POST', 'https://eu.api.ovh.com/1.0/sms/sms-test/jobs')), + ])); + $stack->push(Middleware::history($history)); + $this->app->instance(SmsProviderInterface::class, new OvhSmsProvider(new Client(['handler' => $stack]))); + $recipients = array_map(fn ($id) => ['number' => '+336'.str_pad((string) $id, 8, '0', STR_PAD_LEFT), 'contact_name' => 'Contact '.$id], range(1, 107)); + $campaign = $this->app->make(SmsCampaignSender::class)->send(User::factory()->create(), 'Reunion demain', $recipients); + + $this->assertSame('uncertain', $campaign->status); + $this->assertSame(0, $campaign->failed_count); + $this->assertSame(0, $campaign->sent_count); + $this->assertSame(107, $campaign->deliveries()->where('status', 'uncertain')->count()); + $this->assertSame(107, count($campaign->request_payload['receivers'])); + $this->assertSame('sms-test', $campaign->provider_service_name); + $this->assertSame(60.0, $history[1]['options']['timeout']); + $this->assertCount(2, $history); + $this->assertNull($this->app->make(SmsCampaignSender::class)->sendScheduled($campaign)); + $this->actingAs($campaign->user)->get(route('sms-campaigns.show', $campaign))->assertOk()->assertSee('A verifier')->assertSee('107 destinataire(s) a verifier')->assertDontSee('cURL error'); + $this->actingAs($campaign->user)->get(route('sms-campaigns.index', ['status' => 'uncertain']))->assertOk()->assertSee('A verifier'); + } + + public function test_explicit_rejection_remains_a_failure_but_server_errors_are_uncertain(): void + { + foreach ([400 => 'failed', 503 => 'uncertain'] as $code => $status) { + $provider = $this->provider([new Response(200, [], (string) time()), new Response($code, [], '{"message":"OVH unavailable"}')]); + $sender = new SmsCampaignSender($provider); + $campaign = $sender->send(User::factory()->create(), 'Reunion demain', [['number' => '+33611111111', 'contact_name' => 'Contact']]); + $this->assertSame($status, $campaign->status); + $this->assertSame($status === 'failed' ? 1 : 0, $campaign->failed_count); + } + } + + public function test_incomplete_success_response_does_not_claim_messages_were_sent(): void + { + foreach (['{}', '{"ids":[]}'] as $body) { + $campaign = (new SmsCampaignSender($this->provider([new Response(200, [], (string) time()), new Response(200, [], $body)]))) + ->send(User::factory()->create(), 'Reunion demain', [['number' => '+33611111111', 'contact_name' => 'Contact']]); + $this->assertSame('uncertain', $campaign->status); + $this->assertSame(0, $campaign->sent_count); + } + } + + public function test_reconciliation_confirms_exact_matches_only_and_keeps_missing_recipients_uncertain(): void + { + $campaign = $this->uncertainCampaign(); + $reconciler = new SmsCampaignReconciler($this->provider([])); + $campaign = $reconciler->applyOutgoing($campaign, [ + $this->outgoing($campaign, '+33611111111', 1), + array_merge($this->outgoing($campaign, '+33622222222', 2), ['tag' => 'other-campaign']), + array_merge($this->outgoing($campaign, '+33622222222', 3), ['message' => 'Different message']), + $this->outgoing($campaign, '+33699999999', 4), + ]); + $this->assertSame('uncertain', $campaign->status); + $this->assertSame(1, $campaign->sent_count); + $this->assertSame(0, $campaign->failed_count); + $this->assertDatabaseHas('sms_deliveries', ['number' => '+33611111111', 'status' => 'sent', 'provider_message_id' => '1']); + $this->assertDatabaseHas('sms_deliveries', ['number' => '+33622222222', 'status' => 'uncertain']); + + $campaign = $reconciler->applyOutgoing($campaign, [$this->outgoing($campaign, '+33622222222', 2)]); + $this->assertSame('sent', $campaign->status); + $this->assertSame(2, $campaign->sent_count); + $this->assertNull($campaign->error_message); + $this->assertSame(2, $reconciler->applyOutgoing($campaign, [])->sent_count); + } + + public function test_empty_history_and_api_denial_never_turn_uncertainty_into_failure(): void + { + foreach ([new Response(200, [], '[]'), new Response(403, [], '{"message":"This call has not been granted"}')] as $response) { + $campaign = $this->uncertainCampaign(); + $campaign = (new SmsCampaignReconciler($this->provider([new Response(200, [], (string) time()), $response])))->reconcile($campaign); + $this->assertSame('uncertain', $campaign->status); + $this->assertSame(0, $campaign->failed_count); + $this->assertSame(0, $campaign->sent_count); + } + } + + public function test_scheduler_verifies_using_get_requests_only(): void + { + $campaign = $this->uncertainCampaign(); + $history = []; + $stack = HandlerStack::create(new MockHandler([ + new Response(200, [], (string) time()), + new Response(200, [], '[1,2]'), + new Response(200, [], json_encode($this->outgoing($campaign, '+33622222222', 2))), + new Response(200, [], json_encode($this->outgoing($campaign, '+33611111111', 1))), + ])); + $stack->push(Middleware::history($history)); + $this->app->instance(OvhSmsProvider::class, new OvhSmsProvider(new Client(['handler' => $stack]))); + $this->mock(SmsProviderInterface::class)->shouldNotReceive('send'); + $this->artisan('sms-campaigns:reconcile')->assertSuccessful(); + $this->assertSame('sent', $campaign->fresh()->status); + $this->assertSame(['GET', 'GET', 'GET', 'GET'], array_map(fn ($entry) => $entry['request']->getMethod(), $history)); + $this->assertStringContainsString('tag='.$campaign->provider_tag, (string) $history[1]['request']->getUri()); + $this->assertDatabaseHas('sms_deliveries', ['number' => '+33611111111', 'provider_message_id' => '1']); + } + + public function test_stale_sending_campaign_is_marked_uncertain_even_when_ovh_is_unavailable(): void + { + $campaign = $this->uncertainCampaign(); + $campaign->update(['status' => 'sending']); + SmsCampaign::query()->whereKey($campaign->id)->update(['updated_at' => now()->subMinutes(11)]); + $campaign->deliveries()->update(['status' => 'queued']); + $this->app->instance(OvhSmsProvider::class, $this->provider([new Response(200, [], (string) time()), new Response(403, [], '{}')])); + $this->artisan('sms-campaigns:reconcile')->assertSuccessful(); + $this->assertSame('uncertain', $campaign->fresh()->status); + $this->assertSame(2, $campaign->deliveries()->where('status', 'uncertain')->count()); + } + + public function test_campaign_tags_are_unique_for_sends_created_in_the_same_second(): void + { + $sender = $this->app->make(SmsCampaignSender::class); + $user = User::factory()->create(); + $first = $sender->schedule($user, 'Reunion', [], [], [], now()->addHour()); + $second = $sender->schedule($user, 'Reunion', [], [], [], now()->addHour()); + $this->assertNotSame($first->provider_tag, $second->provider_tag); + } + + private function uncertainCampaign(): SmsCampaign + { + $campaign = SmsCampaign::query()->create(['user_id' => User::factory()->create()->id, 'provider' => 'ovh', 'status' => 'uncertain', 'message' => 'Reunion demain', 'recipients_count' => 2]); + $campaign->update(['provider_tag' => 'relais-sms-campaign-'.$campaign->id]); + foreach (['+33611111111', '+33622222222'] as $number) { + $campaign->deliveries()->create(['number' => $number, 'contact_name' => 'Contact', 'status' => 'uncertain']); + } + + return $campaign->fresh(); + } + + private function outgoing(SmsCampaign $campaign, string $number, int $id): array + { + return ['id' => $id, 'tag' => $campaign->provider_tag, 'receiver' => $number, 'message' => $campaign->message, 'creationDatetime' => '2026-10-06T19:56:24Z', 'ptt' => 1]; + } + + private function provider(array $responses): OvhSmsProvider + { + return new OvhSmsProvider(new Client(['handler' => HandlerStack::create(new MockHandler($responses))])); + } +} diff --git a/tests/Feature/SmsCampaignSendTest.php b/tests/Feature/SmsCampaignSendTest.php new file mode 100644 index 0000000..623e18d --- /dev/null +++ b/tests/Feature/SmsCampaignSendTest.php @@ -0,0 +1,358 @@ + 'other']); + $message = 'Reunion https://zoom.us/j/123'; + $provider = $this->mock(SmsProviderInterface::class); + $provider->shouldReceive('send')->once()->withArgs(fn (SmsCampaign $campaign, array $recipients): bool => $campaign->message === $message) + ->andReturn(new SmsSendResult(serviceName: 'other', providerJobId: '1', requestPayload: ['message' => $message], responsePayload: [])); + $campaign = $this->app->make(SmsCampaignSender::class)->send(User::factory()->create(), $message, []); + $this->assertSame($message, $campaign->message); + } + + public function test_history_keeps_the_message_actually_transmitted_by_ovh(): void + { + config([ + 'relais_sms.ovh.sms_short_code' => true, + 'relais_sms.ovh.sms_sender' => '', + 'relais_sms.ovh.sms_service_name' => 'sms-test', + 'relais_sms.ovh.application_key' => 'test', + 'relais_sms.ovh.application_secret' => 'test', + 'relais_sms.ovh.consumer_key' => 'test', + ]); + $client = new Client(['handler' => HandlerStack::create(new MockHandler([ + new Response(200, [], '123456'), + new Response(200, [], '{"ids":[]}'), + ]))]); + $this->app->instance(SmsProviderInterface::class, new OvhSmsProvider($client)); + $campaign = $this->app->make(SmsCampaignSender::class)->send(User::factory()->create(), 'Reunion https://zoom.us/j/123 demain', []); + $this->assertSame('Reunion demain', $campaign->message); + $this->assertSame('Reunion demain', $campaign->request_payload['message']); + } + + public function test_authenticated_user_can_send_sms_campaign_and_history_is_recorded(): void + { + $this->app->bind(SmsProviderInterface::class, fn (): SmsProviderInterface => new class implements SmsProviderInterface + { + public function send(SmsCampaign $campaign, array $recipients): SmsSendResult + { + return new SmsSendResult( + serviceName: 'sms-test', + providerJobId: 'job-123', + requestPayload: ['receivers' => array_column($recipients, 'number')], + responsePayload: ['ids' => ['message-123']], + providerMessageIds: ['message-123'], + ); + } + }); + + $user = User::factory()->create(); + $contact = $this->createSmsContact(); + + $response = $this->actingAs($user) + ->post(route('sms-campaigns.store'), [ + 'contact_ids' => [$contact->id], + 'message' => 'Message de test', + ]); + + $response->assertRedirect(); + + $this->assertDatabaseHas('sms_campaigns', [ + 'message' => 'Message de test', + 'status' => 'sent', + 'recipients_count' => 1, + 'sent_count' => 1, + 'provider_service_name' => 'sms-test', + 'provider_job_id' => 'job-123', + ]); + + $this->assertDatabaseHas('sms_deliveries', [ + 'contact_id' => $contact->id, + 'number' => '+33611111111', + 'status' => 'sent', + 'provider_message_id' => 'message-123', + ]); + + $this->actingAs($user) + ->get(route('sms-campaigns.index')) + ->assertOk() + ->assertSee('Message de test'); + } + + public function test_sms_campaign_message_uses_configured_header_and_footer_when_selected(): void + { + AppSetting::putString('sms_message_header', 'AFPMA'); + AppSetting::putString('sms_message_footer', 'Envoyer STOP SMS pour ne plus etre contacte.'); + + $this->app->bind(SmsProviderInterface::class, fn (): SmsProviderInterface => new class implements SmsProviderInterface + { + public function send(SmsCampaign $campaign, array $recipients): SmsSendResult + { + return new SmsSendResult( + serviceName: 'sms-test', + providerJobId: 'job-headers', + requestPayload: ['message' => $campaign->message], + responsePayload: ['ids' => ['message-headers']], + providerMessageIds: ['message-headers'], + ); + } + }); + + $user = User::factory()->create(); + $contact = $this->createSmsContact(); + + $this->actingAs($user) + ->post(route('sms-campaigns.store'), [ + 'contact_ids' => [$contact->id], + 'message' => 'Message de test', + 'include_sms_header' => '1', + 'include_sms_footer' => '1', + ]) + ->assertRedirect(); + + $this->assertDatabaseHas('sms_campaigns', [ + 'message' => "AFPMA\nMessage de test\nEnvoyer STOP SMS pour ne plus etre contacte.", + 'provider_job_id' => 'job-headers', + ]); + } + + public function test_sms_campaign_message_can_remove_configured_footer_in_composition(): void + { + AppSetting::putString('sms_message_header', 'AFPMA'); + AppSetting::putString('sms_message_footer', 'Envoyer STOP SMS pour ne plus etre contacte.'); + + $this->app->bind(SmsProviderInterface::class, fn (): SmsProviderInterface => new class implements SmsProviderInterface + { + public function send(SmsCampaign $campaign, array $recipients): SmsSendResult + { + return new SmsSendResult( + serviceName: 'sms-test', + providerJobId: 'job-no-footer', + requestPayload: ['message' => $campaign->message], + responsePayload: ['ids' => ['message-no-footer']], + providerMessageIds: ['message-no-footer'], + ); + } + }); + + $user = User::factory()->create(); + $contact = $this->createSmsContact(); + + $this->actingAs($user) + ->post(route('sms-campaigns.store'), [ + 'contact_ids' => [$contact->id], + 'message' => 'Message de test', + 'include_sms_header' => '1', + 'include_sms_footer' => '0', + ]) + ->assertRedirect(); + + $this->assertDatabaseHas('sms_campaigns', [ + 'message' => "AFPMA\nMessage de test", + 'provider_job_id' => 'job-no-footer', + ]); + } + + public function test_authenticated_user_can_schedule_sms_campaign_without_sending_immediately(): void + { + Carbon::setTestNow(Carbon::parse('2026-06-12 10:00:00', 'UTC')); + + $provider = new class implements SmsProviderInterface + { + public int $calls = 0; + + public function send(SmsCampaign $campaign, array $recipients): SmsSendResult + { + $this->calls++; + + return new SmsSendResult( + serviceName: 'sms-test', + providerJobId: 'job-123', + requestPayload: ['receivers' => array_column($recipients, 'number')], + responsePayload: ['ids' => ['message-123']], + providerMessageIds: ['message-123'], + ); + } + }; + $this->app->instance(SmsProviderInterface::class, $provider); + + $user = User::factory()->create(); + $contact = $this->createSmsContact(); + + $response = $this->actingAs($user) + ->post(route('sms-campaigns.store'), [ + 'contact_ids' => [$contact->id], + 'message' => 'Message programme', + 'send_mode' => 'scheduled', + 'scheduled_at' => '2026-06-12T12:05', + ]); + + $response->assertRedirect(); + + $this->assertSame(0, $provider->calls); + $this->assertDatabaseHas('sms_campaigns', [ + 'message' => 'Message programme', + 'status' => 'scheduled', + 'recipients_count' => 1, + 'sent_count' => 0, + ]); + $this->assertDatabaseHas('sms_deliveries', [ + 'contact_id' => $contact->id, + 'number' => '+33611111111', + 'status' => 'queued', + ]); + } + + public function test_scheduled_campaign_can_be_canceled_before_processing(): void + { + Carbon::setTestNow(Carbon::parse('2026-06-12 10:00:00', 'UTC')); + + $provider = new class implements SmsProviderInterface + { + public int $calls = 0; + + public function send(SmsCampaign $campaign, array $recipients): SmsSendResult + { + $this->calls++; + + return new SmsSendResult('sms-test', 'job-123', [], []); + } + }; + $this->app->instance(SmsProviderInterface::class, $provider); + + $user = User::factory()->create(); + $contact = $this->createSmsContact(); + + $this->actingAs($user) + ->post(route('sms-campaigns.store'), [ + 'contact_ids' => [$contact->id], + 'message' => 'Message annulable', + 'send_mode' => 'scheduled', + 'scheduled_at' => '2026-06-12T12:05', + ]); + + $campaign = SmsCampaign::query()->firstOrFail(); + + $this->actingAs($user) + ->patch(route('sms-campaigns.cancel', $campaign)) + ->assertRedirect(route('sms-campaigns.show', $campaign)); + + $this->assertSame(0, $provider->calls); + $this->assertDatabaseHas('sms_campaigns', [ + 'id' => $campaign->id, + 'status' => 'canceled', + ]); + $this->assertDatabaseHas('sms_deliveries', [ + 'sms_campaign_id' => $campaign->id, + 'status' => 'canceled', + ]); + } + + public function test_due_scheduled_campaign_is_sent_by_scheduler_command(): void + { + Carbon::setTestNow(Carbon::parse('2026-06-12 10:00:00', 'UTC')); + Log::spy(); + + $provider = new class implements SmsProviderInterface + { + public int $calls = 0; + + public function send(SmsCampaign $campaign, array $recipients): SmsSendResult + { + $this->calls++; + + return new SmsSendResult( + serviceName: 'sms-test', + providerJobId: 'job-456', + requestPayload: ['receivers' => array_column($recipients, 'number')], + responsePayload: ['ids' => ['message-456']], + providerMessageIds: ['message-456'], + ); + } + }; + $this->app->instance(SmsProviderInterface::class, $provider); + + $user = User::factory()->create(); + $contact = $this->createSmsContact(); + + $this->actingAs($user) + ->post(route('sms-campaigns.store'), [ + 'contact_ids' => [$contact->id], + 'message' => 'Message automatique', + 'send_mode' => 'scheduled', + 'scheduled_at' => '2026-06-12T12:05', + ]); + + Carbon::setTestNow(Carbon::parse('2026-06-12 10:05:00', 'UTC')); + + $this->artisan('sms-campaigns:send-due') + ->expectsOutput('1 campagne(s) SMS programmee(s) prise(s) en charge.') + ->assertExitCode(0); + + $this->assertSame(1, $provider->calls); + $this->assertDatabaseHas('sms_campaigns', [ + 'message' => 'Message automatique', + 'status' => 'sent', + 'sent_count' => 1, + 'provider_job_id' => 'job-456', + ]); + $this->assertDatabaseHas('sms_deliveries', [ + 'number' => '+33611111111', + 'status' => 'sent', + 'provider_message_id' => 'message-456', + ]); + Log::shouldHaveReceived('info') + ->once() + ->with('SMS campaign status changed from scheduled to sending.', \Mockery::type('array')); + } + + private function createSmsContact(): Contact + { + $contact = Contact::query()->create([ + 'source' => 'local', + 'first_name' => 'Marie', + 'last_name' => 'Durand', + ]); + $contact->phoneNumbers()->create([ + 'raw_number' => '06 11 11 11 11', + 'normalized_number' => '+33611111111', + 'country' => 'FR', + 'is_valid' => true, + 'is_mobile' => true, + 'is_primary' => true, + ]); + + return $contact; + } +} diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..fe1ffc2 --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,10 @@ +parse(<<<'ICS' +BEGIN:VCALENDAR +VERSION:2.0 +BEGIN:VEVENT +UID:event-test +SUMMARY:test +DTSTART;TZID=Europe/Paris:20260613T100000 +DTEND;TZID=Europe/Paris:20260613T110000 +ORGANIZER;CN=Alex Martin:mailto:alex@example.test +ATTENDEE;CN=Marie Durand:mailto:marie@example.test +BEGIN:VALARM +ACTION:DISPLAY +TRIGGER:-PT1H +DESCRIPTION:Rappel +END:VALARM +BEGIN:VALARM +ACTION:EMAIL +TRIGGER:-PT2H +DESCRIPTION:Rappel email +END:VALARM +END:VEVENT +END:VCALENDAR +ICS); + + $this->assertCount(1, $events); + $this->assertSame('event-test', $events[0]->uid); + $this->assertSame('test', $events[0]->summary); + $this->assertSame([ + ['email' => 'alex@example.test', 'name' => 'Alex Martin'], + ['email' => 'marie@example.test', 'name' => 'Marie Durand'], + ], $events[0]->attendees); + $this->assertSame('DISPLAY', $events[0]->alarms[0]->action); + $this->assertSame(-60, $events[0]->alarms[0]->triggerMinutes); + $this->assertSame('EMAIL', $events[0]->alarms[1]->action); + } + + public function test_it_parses_an_attendee_invited_through_a_circle(): void + { + $events = (new ICalendarParser)->parse(<<<'ICS' +BEGIN:VCALENDAR +VERSION:2.0 +BEGIN:VEVENT +UID:circle-event +SUMMARY:Circle test +DTSTART;TZID=Europe/Paris:20260918T000000 +DTEND;TZID=Europe/Paris:20260918T003000 +ORGANIZER;CN=Camille Test:mailto:camille@example.test +ATTENDEE;CN=EquipeTest;CUTYPE=GROUP:mailto:circle+team@example.test +ATTENDEE;CN="Martin; Alex";CUTYPE=INDIVIDUAL;MEMBER="mailto:circle+team@example.test";PARTSTAT=NEEDS-ACTION;RSVP=TRUE;SCHEDULE-STATUS=1.1:mailto:alex@example.test +END:VEVENT +END:VCALENDAR +ICS); + + $this->assertCount(1, $events); + $this->assertSame([ + ['email' => 'camille@example.test', 'name' => 'Camille Test'], + ['email' => 'circle+team@example.test', 'name' => 'EquipeTest'], + ['email' => 'alex@example.test', 'name' => 'Martin; Alex'], + ], $events[0]->attendees); + } +} diff --git a/tests/Unit/CardDav/VCardParserTest.php b/tests/Unit/CardDav/VCardParserTest.php new file mode 100644 index 0000000..c072ecb --- /dev/null +++ b/tests/Unit/CardDav/VCardParserTest.php @@ -0,0 +1,47 @@ +parse($vcard); + + $this->assertSame('contact-123', $contact->uid); + $this->assertSame('Marie Durand', $contact->fullName); + $this->assertSame('Marie', $contact->firstName); + $this->assertSame('Durand', $contact->lastName); + $this->assertSame('AFPMA', $contact->organization); + $this->assertSame('marie@example.test', $contact->email); + $this->assertCount(2, $contact->phoneNumbers); + $this->assertSame('Cell, Voice', $contact->phoneNumbers[0]->label); + $this->assertSame(['Benevoles', 'Conseil, bureau'], $contact->categories); + } + + public function test_it_unfolds_multiline_values(): void + { + $vcard = "BEGIN:VCARD\r\nVERSION:3.0\r\nUID:folded\r\nFN:Association des amis\r\n du lac\r\nTEL:0611110001\r\nEND:VCARD\r\n"; + + $contact = (new VCardParser)->parse($vcard); + + $this->assertSame('Association des amis du lac', $contact->fullName); + } +} diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php new file mode 100644 index 0000000..5773b0c --- /dev/null +++ b/tests/Unit/ExampleTest.php @@ -0,0 +1,16 @@ +assertTrue(true); + } +} diff --git a/tests/Unit/OvhShortCodeMessageTest.php b/tests/Unit/OvhShortCodeMessageTest.php new file mode 100644 index 0000000..a120432 --- /dev/null +++ b/tests/Unit/OvhShortCodeMessageTest.php @@ -0,0 +1,30 @@ +assertSame($expected, (new OvhShortCodeMessage)->prepare($input)); + } + + public static function messages(): array + { + return [ + 'production reminder' => ["Rappel : Réunion Communication\n30/09/2026 10:00\nParticiper à la réunion Zoom https://us06web.zoom.us/j/12345 ID de réunion: 123 456", "Rappel : Réunion Communication\n30/09/2026 10:00\nParticiper à la réunion Zoom ID de réunion: 123 456"], + 'schemes and www' => ['Voir HTTPS://example.org/x?a=b et www.example.fr/test merci', 'Voir et merci'], + 'bare domain' => ['Zoom zoom.us/j/123 puis exemple.fr', 'Zoom puis'], + 'markdown' => ['Rejoindre [la réunion](https://zoom.us/j/123)', 'Rejoindre la réunion'], + 'html' => ['Rejoindre la réunion', 'Rejoindre la réunion'], + 'email phones and date' => ['Contact prenom.nom@example.fr +33 6 12 34 56 78 le 30.09.2026 à 10:00', 'Contact prenom.nom@example.fr +33 6 12 34 56 78 le 30.09.2026 à 10:00'], + 'url only' => ['https://example.org', ''], + 'unicode domain' => ['Voir https://exemple.fr/été et réunion.fr/a', 'Voir et'], + ]; + } +} diff --git a/tests/Unit/PhoneNumberNormalizerTest.php b/tests/Unit/PhoneNumberNormalizerTest.php new file mode 100644 index 0000000..c30f5d2 --- /dev/null +++ b/tests/Unit/PhoneNumberNormalizerTest.php @@ -0,0 +1,59 @@ +normalize('(+33) 6 11 11 00 02', 'FR'); + + $this->assertTrue($result->isValid); + $this->assertTrue($result->isMobile); + $this->assertSame('+33611110002', $result->normalizedNumber); + $this->assertSame('FR', $result->country); + $this->assertNull($result->error); + } + + public function test_it_keeps_fixed_line_numbers_valid_but_not_mobile(): void + { + $result = app(PhoneNumberNormalizerInterface::class)->normalize('01 23 45 67 89', 'FR'); + + $this->assertTrue($result->isValid); + $this->assertFalse($result->isMobile); + $this->assertSame('+33123456789', $result->normalizedNumber); + } + + public function test_it_detects_mobile_numbers_with_libphonenumber_when_regex_does_not_match(): void + { + config(['relais_sms.default_settings.mobile_phone_regex' => '/^never-matches$/']); + + $result = app(PhoneNumberNormalizerInterface::class)->normalize('tel:+33611110002', 'FR'); + + $this->assertTrue($result->isValid); + $this->assertTrue($result->isMobile); + $this->assertSame('+33611110002', $result->normalizedNumber); + } + + public function test_it_detects_dash_separated_french_mobile_numbers(): void + { + $result = app(PhoneNumberNormalizerInterface::class)->normalize('064-201-4207', 'FR'); + + $this->assertTrue($result->isValid); + $this->assertTrue($result->isMobile); + $this->assertSame('+33642014207', $result->normalizedNumber); + } + + public function test_it_reports_invalid_numbers(): void + { + $result = app(PhoneNumberNormalizerInterface::class)->normalize('not a phone', 'FR'); + + $this->assertFalse($result->isValid); + $this->assertFalse($result->isMobile); + $this->assertNull($result->normalizedNumber); + $this->assertNotNull($result->error); + } +} diff --git a/tests/Unit/SmsMessageLengthTest.php b/tests/Unit/SmsMessageLengthTest.php new file mode 100644 index 0000000..5783c50 --- /dev/null +++ b/tests/Unit/SmsMessageLengthTest.php @@ -0,0 +1,36 @@ +assertTrue($length->fitsInOneSms(str_repeat('a', 160))); + $this->assertFalse($length->fitsInOneSms(str_repeat('a', 161))); + $this->assertSame(160, $length->units(str_repeat('^', 80))); + } + + public function test_unicode_message_is_limited_to_70_units(): void + { + $length = new SmsMessageLength; + + $this->assertTrue($length->fitsInOneSms(str_repeat('ê', 70))); + $this->assertFalse($length->fitsInOneSms(str_repeat('ê', 71))); + } + + public function test_value_is_truncated_with_marker_inside_one_sms(): void + { + $length = new SmsMessageLength; + $value = $length->truncateBetween('Rappel : ', str_repeat('a', 200), "\n17/09/2026 14:00"); + $message = 'Rappel : '.$value."\n17/09/2026 14:00"; + + $this->assertStringEndsWith('[...]', $value); + $this->assertTrue($length->fitsInOneSms($message)); + } +} diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..f35b4e7 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,18 @@ +import { defineConfig } from 'vite'; +import laravel from 'laravel-vite-plugin'; +import tailwindcss from '@tailwindcss/vite'; + +export default defineConfig({ + plugins: [ + laravel({ + input: ['resources/css/app.css', 'resources/js/app.js'], + refresh: true, + }), + tailwindcss(), + ], + server: { + watch: { + ignored: ['**/storage/framework/views/**'], + }, + }, +});