From cb09517a46129c583b83192cc9f37497e10ccefe Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Mon, 7 Oct 2024 22:33:57 +0200 Subject: [PATCH 1/2] feat: sending notification after creation of a discussion --- .gitignore | 1 + .phpunit.cache/test-results | 1 - .../Discussion/CreateDiscussionAction.php | 35 + app/Data/Discussion/CreateDiscussionData.php | 16 + app/Livewire/Discussions/Create.php | 44 +- app/Models/Discussion.php | 10 +- app/Traits/WithTagsAssociation.php | 3 + composer.json | 1 + composer.lock | 1848 +++++++++-- config/livewire.php | 180 +- phpunit.xml | 56 +- resources/views/livewire/markdown-x.blade.php | 2904 +++++++++-------- src/Domain/Forum/.gitkeep | 0 src/Domain/Job/.gitkeep | 0 src/Domain/Profile/.gitkeep | 0 src/Domain/Sponsor/.gitkeep | 0 src/Domain/Subscription/.gitkeep | 0 src/Infrastructure/.gitkeep | 0 tests/CreatesApplication.php | 8 +- .../Feature/Actions}/.gitkeep | 0 .../Discussion/CreateDiscussionActionTest.php | 50 + tests/Feature/Livewire/DiscussionTest.php | 32 + tests/TestCase.php | 11 + 23 files changed, 3300 insertions(+), 1900 deletions(-) delete mode 100644 .phpunit.cache/test-results create mode 100644 app/Actions/Discussion/CreateDiscussionAction.php create mode 100644 app/Data/Discussion/CreateDiscussionData.php delete mode 100644 src/Domain/Forum/.gitkeep delete mode 100644 src/Domain/Job/.gitkeep delete mode 100644 src/Domain/Profile/.gitkeep delete mode 100644 src/Domain/Sponsor/.gitkeep delete mode 100644 src/Domain/Subscription/.gitkeep delete mode 100644 src/Infrastructure/.gitkeep rename {src/Domain/Enterprise => tests/Feature/Actions}/.gitkeep (100%) create mode 100644 tests/Feature/Actions/Discussion/CreateDiscussionActionTest.php create mode 100644 tests/Feature/Livewire/DiscussionTest.php diff --git a/.gitignore b/.gitignore index 60636e44..46c08e50 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ composer.phar # Laravel Exclude # +/.phpunit.cache .phpunit.result.cache /public/build /public/hot diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results deleted file mode 100644 index 8173ffbf..00000000 --- a/.phpunit.cache/test-results +++ /dev/null @@ -1 +0,0 @@ -{"version":"pest_2.35.0","defects":[],"times":{"P\\Tests\\Feature\\BasicArchitectureTest::__pest_evaluable__Debug_test__\u2192_there_is_not_any_dd_or_dump_left":0.387,"P\\Tests\\Feature\\Cleanup\\DeleteOldUnverifiedUsersTest::__pest_evaluable_it_will_delete_unverified_users_after_some_days":0.066,"P\\Tests\\Feature\\Cleanup\\DeleteOldUnverifiedUsersTest::__pest_evaluable_it_will_not_delete_verified_users":0.002,"P\\Tests\\Feature\\Forum\\ChannelTest::__pest_evaluable_channel_can_have_children":0.006,"P\\Tests\\Feature\\Forum\\ChannelTest::__pest_evaluable_child_channel_can_be_a_parent":0.004,"P\\Tests\\Feature\\Forum\\DiscussionTest::__pest_evaluable_it_can_find_by_slug":0.003,"P\\Tests\\Feature\\Forum\\DiscussionTest::__pest_evaluable_it_can_give_an_excerpt_of_its_body":0.005,"P\\Tests\\Feature\\Forum\\DiscussionTest::__pest_evaluable_html_in_excerpts_is_markdown_converted":0.003,"P\\Tests\\Feature\\Forum\\DiscussionTest::__pest_evaluable_it_can_have_many_tags":0.004,"P\\Tests\\Feature\\Forum\\DiscussionTest::__pest_evaluable_it_records_activity_when_a_discussion_is_created":0.007,"P\\Tests\\Feature\\Forum\\DiscussionTest::__pest_evaluable_it_generates_a_slug_when_valid_url_characters_provided":0.001,"P\\Tests\\Feature\\Forum\\DiscussionTest::__pest_evaluable_it_generates_a_unique_slug_when_valid_url_characters_provided":0.002,"P\\Tests\\Feature\\Forum\\DiscussionTest::__pest_evaluable_it_generates_a_slug_when_invalid_url_characters_provided":0.022,"P\\Tests\\Feature\\Forum\\ReplyTest::__pest_evaluable_it_records_activity_when_a_reply_is_send":0,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_can_find_by_slug":0.002,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_can_give_an_excerpt_of_its_body":0.002,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_html_in_excerpts_is_markdown_converted":0.002,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_can_have_many_channels":0,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_records_activity_when_a_thread_is_created":0,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_its_conversation_is_old_when_the_oldest_reply_was_six_months_ago":0.005,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_its_conversation_is_old_when_there_are_no_replies_but_the_creation_date_was_six_months_ago":0.002,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_we_can_mark_and_unmark_a_reply_as_the_solution":0.007,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_can_retrieve_the_latest_threads_in_a_correct_order":0.004,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_can_retrieve_only_resolved_threads":0.007,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_can_retrieve_only_active_threads":0.005,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_generates_a_slug_when_valid_url_characters_provided":0.001,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_generates_a_unique_slug_when_valid_url_characters_provided":0.003,"P\\Tests\\Feature\\Forum\\ThreadTest::__pest_evaluable_it_generates_a_slug_when_invalid_url_characters_provided":0.001,"P\\Tests\\Feature\\UserActivitiesTest::__pest_evaluable_it_records_activity_when_an_article_is_created":0,"P\\Tests\\Feature\\UserActivitiesTest::__pest_evaluable_it_get_feed_from_any_user":0}} \ No newline at end of file diff --git a/app/Actions/Discussion/CreateDiscussionAction.php b/app/Actions/Discussion/CreateDiscussionAction.php new file mode 100644 index 00000000..f1ba3d96 --- /dev/null +++ b/app/Actions/Discussion/CreateDiscussionAction.php @@ -0,0 +1,35 @@ +create([ + 'title' => $discussionData->title, + 'slug' => $discussionData->title, + 'body' => $discussionData->body, + 'user_id' => Auth::id(), + ]); + + if (collect($discussionData->tags)->isNotEmpty()) { + $discussion->syncTags($discussionData->tags); + } + + givePoint(new DiscussionCreated($discussion)); + + Auth::user()?->notify(new PostDiscussionToTelegram($discussion)); + + return $discussion; + } +} diff --git a/app/Data/Discussion/CreateDiscussionData.php b/app/Data/Discussion/CreateDiscussionData.php new file mode 100644 index 00000000..811eacbb --- /dev/null +++ b/app/Data/Discussion/CreateDiscussionData.php @@ -0,0 +1,16 @@ + 'onMarkdownUpdate']; - - /** - * @var array - */ - protected $rules = [ - 'title' => ['required', 'max:150'], - 'body' => ['required'], - 'tags_selected' => 'nullable|array', - ]; - + #[On('markdown-x:update')] public function onMarkdownUpdate(string $content): void { $this->body = $content; @@ -44,24 +33,13 @@ public function store(): void { $this->validate(); - $discussion = Discussion::create([ + $discussion = app(CreateDiscussionAction::class)->execute(CreateDiscussionData::from([ 'title' => $this->title, - 'slug' => $this->title, 'body' => $this->body, - 'user_id' => Auth::id(), - ]); - - if (collect($this->associateTags)->isNotEmpty()) { - $discussion->syncTags($this->associateTags); - } - - givePoint(new DiscussionCreated($discussion)); - - if (app()->environment('production')) { - Auth::user()->notify(new PostDiscussionToTelegram($discussion)); // @phpstan-ignore-line - } + 'tags' => $this->associateTags, + ])); - $this->redirectRoute('discussions.show', $discussion); + $this->redirectRoute('discussions.show', $discussion, navigate: true); } public function render(): View diff --git a/app/Models/Discussion.php b/app/Models/Discussion.php index 3c41f9d0..93d595cb 100644 --- a/app/Models/Discussion.php +++ b/app/Models/Discussion.php @@ -22,7 +22,15 @@ use Illuminate\Support\Str; /** - * @mixin IdeHelperDiscussion + * @property int $id + * @property int $user_id + * @property string $title + * @property string $slug + * @property string $body + * @property bool $is_pinned + * @property bool $locked + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at */ final class Discussion extends Model implements ReactableInterface, ReplyInterface, SubscribeInterface, Viewable { diff --git a/app/Traits/WithTagsAssociation.php b/app/Traits/WithTagsAssociation.php index 18e67e69..d9c43446 100644 --- a/app/Traits/WithTagsAssociation.php +++ b/app/Traits/WithTagsAssociation.php @@ -4,11 +4,14 @@ namespace App\Traits; +use Livewire\Attributes\Validate; + trait WithTagsAssociation { /** * @var array */ + #[Validate('nullable|array')] public array $tags_selected = []; /** diff --git a/composer.json b/composer.json index c5cfce64..76beff13 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,7 @@ "ramsey/uuid": "^4.7.4", "sentry/sentry-laravel": "^3.7", "socialiteproviders/twitter": "^4.1.2", + "spatie/laravel-data": "^4.10", "spatie/laravel-feed": "^4.2.1", "spatie/laravel-google-fonts": "^1.2.3", "spatie/laravel-medialibrary": "^10.10.0", diff --git a/composer.lock b/composer.lock index 17289037..12bbe680 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9ad9c5d24eedfed1801a5ca09a219930", + "content-hash": "c0eaf46dae1627cc479ad1e1ca429cd8", "packages": [ { "name": "abraham/twitteroauth", @@ -68,6 +68,865 @@ }, "time": "2023-10-28T20:17:00+00:00" }, + { + "name": "amphp/amp", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "138801fb68cfc9c329da8a7b39d01ce7291ee4b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/138801fb68cfc9c329da8a7b39d01ce7291ee4b0", + "reference": "138801fb68cfc9c329da8a7b39d01ce7291ee4b0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "phpunit/phpunit": "^9", + "psalm/phar": "5.23.1" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php", + "src/Future/functions.php", + "src/Internal/functions.php" + ], + "psr-4": { + "Amp\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "https://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "support": { + "issues": "https://github.com/amphp/amp/issues", + "source": "https://github.com/amphp/amp/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-05-10T21:37:46+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v2.1.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "daa00f2efdbd71565bf64ffefa89e37542addf93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/daa00f2efdbd71565bf64ffefa89e37542addf93", + "reference": "daa00f2efdbd71565bf64ffefa89e37542addf93", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/parser": "^1.1", + "amphp/pipeline": "^1", + "amphp/serialization": "^1", + "amphp/sync": "^2", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2.3" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "5.22.1" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php", + "src/Internal/functions.php" + ], + "psr-4": { + "Amp\\ByteStream\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "https://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "support": { + "issues": "https://github.com/amphp/byte-stream/issues", + "source": "https://github.com/amphp/byte-stream/tree/v2.1.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-02-17T04:49:38+00:00" + }, + { + "name": "amphp/cache", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/cache.git", + "reference": "46912e387e6aa94933b61ea1ead9cf7540b7797c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/cache/zipball/46912e387e6aa94933b61ea1ead9cf7540b7797c", + "reference": "46912e387e6aa94933b61ea1ead9cf7540b7797c", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/serialization": "^1", + "amphp/sync": "^2", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Cache\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + } + ], + "description": "A fiber-aware cache API based on Amp and Revolt.", + "homepage": "https://amphp.org/cache", + "support": { + "issues": "https://github.com/amphp/cache/issues", + "source": "https://github.com/amphp/cache/tree/v2.0.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-04-19T03:38:06+00:00" + }, + { + "name": "amphp/dns", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/dns.git", + "reference": "758266b0ea7470e2e42cd098493bc6d6c7100cf7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/dns/zipball/758266b0ea7470e2e42cd098493bc6d6c7100cf7", + "reference": "758266b0ea7470e2e42cd098493bc6d6c7100cf7", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/cache": "^2", + "amphp/parser": "^1", + "amphp/windows-registry": "^1.0.1", + "daverandom/libdns": "^2.0.2", + "ext-filter": "*", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "5.20" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Amp\\Dns\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Wright", + "email": "addr@daverandom.com" + }, + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + } + ], + "description": "Async DNS resolution for Amp.", + "homepage": "https://github.com/amphp/dns", + "keywords": [ + "amp", + "amphp", + "async", + "client", + "dns", + "resolve" + ], + "support": { + "issues": "https://github.com/amphp/dns/issues", + "source": "https://github.com/amphp/dns/tree/v2.2.0" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-06-02T19:54:12+00:00" + }, + { + "name": "amphp/parallel", + "version": "v2.2.9", + "source": { + "type": "git", + "url": "https://github.com/amphp/parallel.git", + "reference": "73d293f1fc4df1bebc3c4fce1432e82dd7032238" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/parallel/zipball/73d293f1fc4df1bebc3c4fce1432e82dd7032238", + "reference": "73d293f1fc4df1bebc3c4fce1432e82dd7032238", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/cache": "^2", + "amphp/parser": "^1", + "amphp/pipeline": "^1", + "amphp/process": "^2", + "amphp/serialization": "^1", + "amphp/socket": "^2", + "amphp/sync": "^2", + "php": ">=8.1", + "revolt/event-loop": "^1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.18" + }, + "type": "library", + "autoload": { + "files": [ + "src/Context/functions.php", + "src/Context/Internal/functions.php", + "src/Ipc/functions.php", + "src/Worker/functions.php" + ], + "psr-4": { + "Amp\\Parallel\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Stephen Coakley", + "email": "me@stephencoakley.com" + } + ], + "description": "Parallel processing component for Amp.", + "homepage": "https://github.com/amphp/parallel", + "keywords": [ + "async", + "asynchronous", + "concurrent", + "multi-processing", + "multi-threading" + ], + "support": { + "issues": "https://github.com/amphp/parallel/issues", + "source": "https://github.com/amphp/parallel/tree/v2.2.9" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-03-24T18:27:44+00:00" + }, + { + "name": "amphp/parser", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/parser.git", + "reference": "3cf1f8b32a0171d4b1bed93d25617637a77cded7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/parser/zipball/3cf1f8b32a0171d4b1bed93d25617637a77cded7", + "reference": "3cf1f8b32a0171d4b1bed93d25617637a77cded7", + "shasum": "" + }, + "require": { + "php": ">=7.4" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Parser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A generator parser to make streaming parsers simple.", + "homepage": "https://github.com/amphp/parser", + "keywords": [ + "async", + "non-blocking", + "parser", + "stream" + ], + "support": { + "issues": "https://github.com/amphp/parser/issues", + "source": "https://github.com/amphp/parser/tree/v1.1.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-03-21T19:16:53+00:00" + }, + { + "name": "amphp/pipeline", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/pipeline.git", + "reference": "66c095673aa5b6e689e63b52d19e577459129ab3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/pipeline/zipball/66c095673aa5b6e689e63b52d19e577459129ab3", + "reference": "66c095673aa5b6e689e63b52d19e577459129ab3", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "php": ">=8.1", + "revolt/event-loop": "^1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.18" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Pipeline\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Asynchronous iterators and operators.", + "homepage": "https://amphp.org/pipeline", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "iterator", + "non-blocking" + ], + "support": { + "issues": "https://github.com/amphp/pipeline/issues", + "source": "https://github.com/amphp/pipeline/tree/v1.2.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-07-04T00:56:47+00:00" + }, + { + "name": "amphp/process", + "version": "v2.0.3", + "source": { + "type": "git", + "url": "https://github.com/amphp/process.git", + "reference": "52e08c09dec7511d5fbc1fb00d3e4e79fc77d58d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/process/zipball/52e08c09dec7511d5fbc1fb00d3e4e79fc77d58d", + "reference": "52e08c09dec7511d5fbc1fb00d3e4e79fc77d58d", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/sync": "^2", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.4" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Amp\\Process\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A fiber-aware process manager based on Amp and Revolt.", + "homepage": "https://amphp.org/process", + "support": { + "issues": "https://github.com/amphp/process/issues", + "source": "https://github.com/amphp/process/tree/v2.0.3" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-04-19T03:13:44+00:00" + }, + { + "name": "amphp/serialization", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/serialization.git", + "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/serialization/zipball/693e77b2fb0b266c3c7d622317f881de44ae94a1", + "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "phpunit/phpunit": "^9 || ^8 || ^7" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Amp\\Serialization\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Serialization tools for IPC and data storage in PHP.", + "homepage": "https://github.com/amphp/serialization", + "keywords": [ + "async", + "asynchronous", + "serialization", + "serialize" + ], + "support": { + "issues": "https://github.com/amphp/serialization/issues", + "source": "https://github.com/amphp/serialization/tree/master" + }, + "time": "2020-03-25T21:39:07+00:00" + }, + { + "name": "amphp/socket", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/socket.git", + "reference": "58e0422221825b79681b72c50c47a930be7bf1e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/socket/zipball/58e0422221825b79681b72c50c47a930be7bf1e1", + "reference": "58e0422221825b79681b72c50c47a930be7bf1e1", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/dns": "^2", + "ext-openssl": "*", + "kelunik/certificate": "^1.1", + "league/uri": "^6.5 | ^7", + "league/uri-interfaces": "^2.3 | ^7", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "amphp/process": "^2", + "phpunit/phpunit": "^9", + "psalm/phar": "5.20" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php", + "src/Internal/functions.php", + "src/SocketAddress/functions.php" + ], + "psr-4": { + "Amp\\Socket\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@gmail.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Non-blocking socket connection / server implementations based on Amp and Revolt.", + "homepage": "https://github.com/amphp/socket", + "keywords": [ + "amp", + "async", + "encryption", + "non-blocking", + "sockets", + "tcp", + "tls" + ], + "support": { + "issues": "https://github.com/amphp/socket/issues", + "source": "https://github.com/amphp/socket/tree/v2.3.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-04-21T14:33:03+00:00" + }, + { + "name": "amphp/sync", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/sync.git", + "reference": "217097b785130d77cfcc58ff583cf26cd1770bf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/sync/zipball/217097b785130d77cfcc58ff583cf26cd1770bf1", + "reference": "217097b785130d77cfcc58ff583cf26cd1770bf1", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/pipeline": "^1", + "amphp/serialization": "^1", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "5.23" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Amp\\Sync\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Stephen Coakley", + "email": "me@stephencoakley.com" + } + ], + "description": "Non-blocking synchronization primitives for PHP based on Amp and Revolt.", + "homepage": "https://github.com/amphp/sync", + "keywords": [ + "async", + "asynchronous", + "mutex", + "semaphore", + "synchronization" + ], + "support": { + "issues": "https://github.com/amphp/sync/issues", + "source": "https://github.com/amphp/sync/tree/v2.3.0" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-08-03T19:31:26+00:00" + }, + { + "name": "amphp/windows-registry", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/windows-registry.git", + "reference": "0d569e8f256cca974e3842b6e78b4e434bf98306" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/windows-registry/zipball/0d569e8f256cca974e3842b6e78b4e434bf98306", + "reference": "0d569e8f256cca974e3842b6e78b4e434bf98306", + "shasum": "" + }, + "require": { + "amphp/byte-stream": "^2", + "amphp/process": "^2", + "php": ">=8.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "psalm/phar": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\WindowsRegistry\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Windows Registry Reader.", + "support": { + "issues": "https://github.com/amphp/windows-registry/issues", + "source": "https://github.com/amphp/windows-registry/tree/v1.0.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-01-30T23:01:51+00:00" + }, { "name": "anourvalar/eloquent-serialize", "version": "1.2.23", @@ -1048,6 +1907,50 @@ }, "time": "2024-08-09T14:30:48+00:00" }, + { + "name": "daverandom/libdns", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/DaveRandom/LibDNS.git", + "reference": "b84c94e8fe6b7ee4aecfe121bfe3b6177d303c8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DaveRandom/LibDNS/zipball/b84c94e8fe6b7ee4aecfe121bfe3b6177d303c8a", + "reference": "b84c94e8fe6b7ee4aecfe121bfe3b6177d303c8a", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "Required for IDN support" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "LibDNS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "DNS protocol implementation written in pure PHP", + "keywords": [ + "dns" + ], + "support": { + "issues": "https://github.com/DaveRandom/LibDNS/issues", + "source": "https://github.com/DaveRandom/LibDNS/tree/v2.1.0" + }, + "time": "2024-04-12T12:12:48+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.3", @@ -3460,7 +4363,78 @@ }, "autoload": { "psr-4": { - "Jenssegers\\Agent\\": "src/" + "Jenssegers\\Agent\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jens Segers", + "homepage": "https://jenssegers.com" + } + ], + "description": "Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect", + "homepage": "https://github.com/jenssegers/agent", + "keywords": [ + "Agent", + "browser", + "desktop", + "laravel", + "mobile", + "platform", + "user agent", + "useragent" + ], + "support": { + "issues": "https://github.com/jenssegers/agent/issues", + "source": "https://github.com/jenssegers/agent/tree/v2.6.4" + }, + "funding": [ + { + "url": "https://github.com/jenssegers", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/jenssegers/agent", + "type": "tidelift" + } + ], + "time": "2020-06-13T08:05:20+00:00" + }, + { + "name": "kelunik/certificate", + "version": "v1.1.3", + "source": { + "type": "git", + "url": "https://github.com/kelunik/certificate.git", + "reference": "7e00d498c264d5eb4f78c69f41c8bd6719c0199e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kelunik/certificate/zipball/7e00d498c264d5eb4f78c69f41c8bd6719c0199e", + "reference": "7e00d498c264d5eb4f78c69f41c8bd6719c0199e", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "php": ">=7.0" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "phpunit/phpunit": "^6 | 7 | ^8 | ^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Kelunik\\Certificate\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3469,37 +4443,24 @@ ], "authors": [ { - "name": "Jens Segers", - "homepage": "https://jenssegers.com" + "name": "Niklas Keller", + "email": "me@kelunik.com" } ], - "description": "Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect", - "homepage": "https://github.com/jenssegers/agent", + "description": "Access certificate details and transform between different formats.", "keywords": [ - "Agent", - "browser", - "desktop", - "laravel", - "mobile", - "platform", - "user agent", - "useragent" + "DER", + "certificate", + "certificates", + "openssl", + "pem", + "x509" ], "support": { - "issues": "https://github.com/jenssegers/agent/issues", - "source": "https://github.com/jenssegers/agent/tree/v2.6.4" + "issues": "https://github.com/kelunik/certificate/issues", + "source": "https://github.com/kelunik/certificate/tree/v1.1.3" }, - "funding": [ - { - "url": "https://github.com/jenssegers", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/jenssegers/agent", - "type": "tidelift" - } - ], - "time": "2020-06-13T08:05:20+00:00" + "time": "2023-02-03T21:26:53+00:00" }, { "name": "kirschbaum-development/eloquent-power-joins", @@ -7130,10 +8091,260 @@ "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" }, - "type": "library", + "type": "library", + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.3.1" + }, + "time": "2024-03-15T13:55:21+00:00" + }, + { + "name": "phpdocumentor/reflection", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/Reflection.git", + "reference": "61e2f1fe7683e9647b9ed8d9e53d08699385267d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/61e2f1fe7683e9647b9ed8d9e53d08699385267d", + "reference": "61e2f1fe7683e9647b9ed8d9e53d08699385267d", + "shasum": "" + }, + "require": { + "nikic/php-parser": "~4.18 || ^5.0", + "php": "8.1.*|8.2.*|8.3.*", + "phpdocumentor/reflection-common": "^2.1", + "phpdocumentor/reflection-docblock": "^5", + "phpdocumentor/type-resolver": "^1.2", + "symfony/polyfill-php80": "^1.28", + "webmozart/assert": "^1.7" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "doctrine/coding-standard": "^12.0", + "mikey179/vfsstream": "~1.2", + "mockery/mockery": "~1.6.0", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^10.0", + "psalm/phar": "^5.24", + "rector/rector": "^1.0.0", + "squizlabs/php_codesniffer": "^3.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-5.x": "5.3.x-dev", + "dev-6.x": "6.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\": "src/phpDocumentor" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Reflection library to do Static Analysis for PHP Projects", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/Reflection/issues", + "source": "https://github.com/phpDocumentor/Reflection/tree/6.0.0" + }, + "time": "2024-05-23T19:28:12+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.4.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.1", + "ext-filter": "*", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.7", + "phpstan/phpdoc-parser": "^1.7", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.5", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" + }, + "time": "2024-05-21T05:55:05+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "153ae662783729388a584b4361f2545e4d841e3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", + "reference": "153ae662783729388a584b4361f2545e4d841e3c", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, "autoload": { "psr-4": { - "Http\\Promise\\": "src/" + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -7142,24 +8353,16 @@ ], "authors": [ { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" } ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", - "keywords": [ - "promise" - ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { - "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.3.1" + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" }, - "time": "2024-03-15T13:55:21+00:00" + "time": "2024-02-23T11:10:43+00:00" }, { "name": "phpoption/phpoption", @@ -7346,6 +8549,53 @@ ], "time": "2024-08-12T00:13:54+00:00" }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.29.1", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" + }, + "time": "2024-05-31T08:52:43+00:00" + }, { "name": "pragmarx/google2fa", "version": "v8.0.1", @@ -8231,6 +9481,78 @@ ], "time": "2024-04-27T21:32:50+00:00" }, + { + "name": "revolt/event-loop", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/revoltphp/event-loop.git", + "reference": "25de49af7223ba039f64da4ae9a28ec2d10d0254" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/revoltphp/event-loop/zipball/25de49af7223ba039f64da4ae9a28ec2d10d0254", + "reference": "25de49af7223ba039f64da4ae9a28ec2d10d0254", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.15" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Revolt\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Rock-solid event loop for concurrent PHP applications.", + "keywords": [ + "async", + "asynchronous", + "concurrency", + "event", + "event-loop", + "non-blocking", + "scheduler" + ], + "support": { + "issues": "https://github.com/revoltphp/event-loop/issues", + "source": "https://github.com/revoltphp/event-loop/tree/v1.0.6" + }, + "time": "2023-11-30T05:34:44+00:00" + }, { "name": "ryangjchandler/blade-capture-directive", "version": "v1.0.0", @@ -9132,6 +10454,90 @@ ], "time": "2024-05-17T09:06:10+00:00" }, + { + "name": "spatie/laravel-data", + "version": "4.10.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-data.git", + "reference": "d3113c6bc03a6f1c241074d6f5832e05daa7ca77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-data/zipball/d3113c6bc03a6f1c241074d6f5832e05daa7ca77", + "reference": "d3113c6bc03a6f1c241074d6f5832e05daa7ca77", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^10.0|^11.0", + "php": "^8.1", + "phpdocumentor/reflection": "^6.0", + "spatie/laravel-package-tools": "^1.9.0", + "spatie/php-structure-discoverer": "^2.0" + }, + "require-dev": { + "fakerphp/faker": "^1.14", + "friendsofphp/php-cs-fixer": "^3.0", + "inertiajs/inertia-laravel": "^1.2", + "livewire/livewire": "^3.0", + "mockery/mockery": "^1.6", + "nesbot/carbon": "^2.63", + "nunomaduro/larastan": "^2.0", + "orchestra/testbench": "^8.0|^9.0", + "pestphp/pest": "^2.31", + "pestphp/pest-plugin-laravel": "^2.0", + "pestphp/pest-plugin-livewire": "^2.1", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpunit/phpunit": "^10.0", + "spatie/invade": "^1.0", + "spatie/laravel-typescript-transformer": "^2.3", + "spatie/pest-plugin-snapshots": "^2.1", + "spatie/test-time": "^1.2" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\LaravelData\\LaravelDataServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Spatie\\LaravelData\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ruben Van Assche", + "email": "ruben@spatie.be", + "role": "Developer" + } + ], + "description": "Create unified resources and data transfer objects", + "homepage": "https://github.com/spatie/laravel-data", + "keywords": [ + "laravel", + "laravel-data", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-data/issues", + "source": "https://github.com/spatie/laravel-data/tree/4.10.1" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2024-10-07T08:36:46+00:00" + }, { "name": "spatie/laravel-feed", "version": "4.4.0", @@ -9718,16 +11124,106 @@ "extra": { "laravel": { "providers": [ - "Spatie\\Translatable\\TranslatableServiceProvider" + "Spatie\\Translatable\\TranslatableServiceProvider" + ] + }, + "aliases": { + "Translatable": "Spatie\\Translatable\\Facades\\Translatable" + } + }, + "autoload": { + "psr-4": { + "Spatie\\Translatable\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + }, + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A trait to make an Eloquent model hold translations", + "homepage": "https://github.com/spatie/laravel-translatable", + "keywords": [ + "eloquent", + "i8n", + "laravel-translatable", + "model", + "multilingual", + "spatie", + "translate" + ], + "support": { + "issues": "https://github.com/spatie/laravel-translatable/issues", + "source": "https://github.com/spatie/laravel-translatable/tree/6.8.0" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2024-07-24T14:26:27+00:00" + }, + { + "name": "spatie/php-structure-discoverer", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/php-structure-discoverer.git", + "reference": "271542206169d95dd2ffe346ddf11f37672553a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/php-structure-discoverer/zipball/271542206169d95dd2ffe346ddf11f37672553a2", + "reference": "271542206169d95dd2ffe346ddf11f37672553a2", + "shasum": "" + }, + "require": { + "amphp/amp": "^v3.0", + "amphp/parallel": "^2.2", + "illuminate/collections": "^10.0|^11.0", + "php": "^8.1", + "spatie/laravel-package-tools": "^1.4.3", + "symfony/finder": "^6.0|^7.0" + }, + "require-dev": { + "illuminate/console": "^10.0|^11.0", + "laravel/pint": "^1.0", + "nunomaduro/collision": "^7.0|^8.0", + "nunomaduro/larastan": "^2.0.1", + "orchestra/testbench": "^7.0|^8.0|^9.0", + "pestphp/pest": "^2.0", + "pestphp/pest-plugin-laravel": "^2.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5|^10.0", + "spatie/laravel-ray": "^1.26" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\StructureDiscoverer\\StructureDiscovererServiceProvider" ] - }, - "aliases": { - "Translatable": "Spatie\\Translatable\\Facades\\Translatable" } }, "autoload": { "psr-4": { - "Spatie\\Translatable\\": "src" + "Spatie\\StructureDiscoverer\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -9736,40 +11232,30 @@ ], "authors": [ { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - }, - { - "name": "Sebastian De Deyne", - "email": "sebastian@spatie.be", - "homepage": "https://spatie.be", + "name": "Ruben Van Assche", + "email": "ruben@spatie.be", "role": "Developer" } ], - "description": "A trait to make an Eloquent model hold translations", - "homepage": "https://github.com/spatie/laravel-translatable", + "description": "Automatically discover structures within your PHP application", + "homepage": "https://github.com/spatie/php-structure-discoverer", "keywords": [ - "eloquent", - "i8n", - "laravel-translatable", - "model", - "multilingual", - "spatie", - "translate" + "discover", + "laravel", + "php", + "php-structure-discoverer" ], "support": { - "issues": "https://github.com/spatie/laravel-translatable/issues", - "source": "https://github.com/spatie/laravel-translatable/tree/6.8.0" + "issues": "https://github.com/spatie/php-structure-discoverer/issues", + "source": "https://github.com/spatie/php-structure-discoverer/tree/2.2.0" }, "funding": [ { - "url": "https://github.com/spatie", + "url": "https://github.com/LaravelAutoDiscoverer", "type": "github" } ], - "time": "2024-07-24T14:26:27+00:00" + "time": "2024-08-29T10:43:45+00:00" }, { "name": "spatie/robots-txt", @@ -15068,181 +16554,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.4.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.1", - "ext-filter": "*", - "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.5", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-webmozart-assert": "^1.2", - "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" - }, - "time": "2024-05-21T05:55:05+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.8.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.3 || ^8.0", - "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" - }, - "require-dev": { - "ext-tokenizer": "*", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" - }, - "time": "2024-02-23T11:10:43+00:00" - }, { "name": "phpmyadmin/sql-parser", "version": "5.9.1", @@ -15330,53 +16641,6 @@ ], "time": "2024-08-13T19:01:01+00:00" }, - { - "name": "phpstan/phpdoc-parser", - "version": "1.29.1", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", - "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" - }, - "time": "2024-05-31T08:52:43+00:00" - }, { "name": "phpstan/phpstan", "version": "1.11.10", diff --git a/config/livewire.php b/config/livewire.php index cd023226..f2dc751e 100644 --- a/config/livewire.php +++ b/config/livewire.php @@ -5,156 +5,158 @@ return [ /* - |-------------------------------------------------------------------------- + |--------------------------------------------------------------------------- | Class Namespace - |-------------------------------------------------------------------------- + |--------------------------------------------------------------------------- | - | This value sets the root namespace for Livewire component classes in - | your application. This value affects component auto-discovery and - | any Livewire file helper commands, like `artisan make:livewire`. - | - | After changing this item, run: `php artisan livewire:discover`. + | This value sets the root class namespace for Livewire component classes in + | your application. This value will change where component auto-discovery + | finds components. It's also referenced by the file creation commands. | */ - 'class_namespace' => 'App\\Http\\Livewire', + 'class_namespace' => 'App\\Livewire', /* - |-------------------------------------------------------------------------- + |--------------------------------------------------------------------------- | View Path - |-------------------------------------------------------------------------- + |--------------------------------------------------------------------------- | - | This value sets the path for Livewire component views. This affects - | file manipulation helper commands like `artisan make:livewire`. + | This value is used to specify where Livewire component Blade templates are + | stored when running file creation commands like `artisan make:livewire`. + | It is also used if you choose to omit a component's render() method. | */ 'view_path' => resource_path('views/livewire'), /* - |-------------------------------------------------------------------------- + |--------------------------------------------------------------------------- | Layout - |-------------------------------------------------------------------------- - | The default layout view that will be used when rendering a component via - | Route::get('/some-endpoint', SomeComponent::class);. In this case the - | the view returned by SomeComponent will be wrapped in "layouts.app" + |--------------------------------------------------------------------------- + | The view that will be used as the layout when rendering a single component + | as an entire page via `Route::get('/post/create', CreatePost::class);`. + | In this case, the view returned by CreatePost will render into $slot. | */ 'layout' => 'layouts.app', /* - |-------------------------------------------------------------------------- - | Livewire Assets URL - |-------------------------------------------------------------------------- + |--------------------------------------------------------------------------- + | Lazy Loading Placeholder + |--------------------------------------------------------------------------- + | Livewire allows you to lazy load components that would otherwise slow down + | the initial page load. Every component can have a custom placeholder or + | you can define the default placeholder view for all components below. | - | This value sets the path to Livewire JavaScript assets, for cases where - | your app's domain root is not the correct path. By default, Livewire - | will load its JavaScript assets from the app's "relative root". + */ + + 'lazy_placeholder' => null, + + /* + |--------------------------------------------------------------------------- + | Temporary File Uploads + |--------------------------------------------------------------------------- | - | Examples: "/assets", "myurl.com/app". + | Livewire handles file uploads by storing uploads in a temporary directory + | before the file is stored permanently. All file uploads are directed to + | a global endpoint for temporary storage. You may configure this below: | */ - 'asset_url' => null, + 'temporary_file_upload' => [ + 'disk' => null, // Example: 'local', 's3' | Default: 'default' + 'rules' => null, // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB) + 'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp' + 'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1' + 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs... + 'png', 'gif', 'bmp', 'svg', 'wav', 'mp4', + 'mov', 'avi', 'wmv', 'mp3', 'm4a', + 'jpg', 'jpeg', 'mpga', 'webp', 'wma', + ], + 'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated... + 'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs... + ], /* - |-------------------------------------------------------------------------- - | Livewire App URL - |-------------------------------------------------------------------------- - | - | This value should be used if livewire assets are served from CDN. - | Livewire will communicate with an app through this url. + |--------------------------------------------------------------------------- + | Render On Redirect + |--------------------------------------------------------------------------- | - | Examples: "https://my-app.com", "myurl.com/app". + | This value determines if Livewire will run a component's `render()` method + | after a redirect has been triggered using something like `redirect(...)` + | Setting this to true will render the view once more before redirecting | */ - 'app_url' => null, + 'render_on_redirect' => false, /* - |-------------------------------------------------------------------------- - | Livewire Endpoint Middleware Group - |-------------------------------------------------------------------------- + |--------------------------------------------------------------------------- + | Eloquent Model Binding + |--------------------------------------------------------------------------- | - | This value sets the middleware group that will be applied to the main - | Livewire "message" endpoint (the endpoint that gets hit everytime - | a Livewire component updates). It is set to "web" by default. + | Previous versions of Livewire supported binding directly to eloquent model + | properties using wire:model by default. However, this behavior has been + | deemed too "magical" and has therefore been put under a feature flag. | */ - 'middleware_group' => 'web', + 'legacy_model_binding' => false, /* - |-------------------------------------------------------------------------- - | Livewire Temporary File Uploads Endpoint Configuration - |-------------------------------------------------------------------------- + |--------------------------------------------------------------------------- + | Auto-inject Frontend Assets + |--------------------------------------------------------------------------- | - | Livewire handles file uploads by storing uploads in a temporary directory - | before the file is validated and stored permanently. All file uploads - | are directed to a global endpoint for temporary storage. The config - | items below are used for customizing the way the endpoint works. + | By default, Livewire automatically injects its JavaScript and CSS into the + | and of pages containing Livewire components. By disabling + | this behavior, you need to use @livewireStyles and @livewireScripts. | */ - 'temporary_file_upload' => [ - 'disk' => null, // Example: 'local', 's3' Default: 'default' - 'rules' => null, // Example: ['file', 'mimes:png,jpg'] Default: ['required', 'file', 'max:12288'] (12MB) - 'directory' => null, // Example: 'tmp' Default 'livewire-tmp' - 'middleware' => null, // Example: 'throttle:5,1' Default: 'throttle:60,1' - 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs. - 'png', 'gif', 'bmp', 'svg', 'wav', 'mp4', - 'mov', 'avi', 'wmv', 'mp3', 'm4a', - 'jpg', 'jpeg', 'mpga', 'webp', 'wma', - ], - 'max_upload_time' => 5, // Max duration (in minutes) before an upload gets invalidated. - ], + 'inject_assets' => true, /* - |-------------------------------------------------------------------------- - | Manifest File Path - |-------------------------------------------------------------------------- - | - | This value sets the path to the Livewire manifest file. - | The default should work for most cases (which is - | "/bootstrap/cache/livewire-components.php"), but for specific - | cases like when hosting on Laravel Vapor, it could be set to a different value. + |--------------------------------------------------------------------------- + | Navigate (SPA mode) + |--------------------------------------------------------------------------- | - | Example: for Laravel Vapor, it would be "/tmp/storage/bootstrap/cache/livewire-components.php". + | By adding `wire:navigate` to links in your Livewire application, Livewire + | will prevent the default link handling and instead request those pages + | via AJAX, creating an SPA-like effect. Configure this behavior here. | */ - 'manifest_path' => null, + 'navigate' => [ + 'show_progress_bar' => true, + 'progress_bar_color' => '#2299dd', + ], /* - |-------------------------------------------------------------------------- - | Back Button Cache - |-------------------------------------------------------------------------- - | - | This value determines whether the back button cache will be used on pages - | that contain Livewire. By disabling back button cache, it ensures that - | the back button shows the correct state of components, instead of - | potentially stale, cached data. + |--------------------------------------------------------------------------- + | HTML Morph Markers + |--------------------------------------------------------------------------- | - | Setting it to "false" (default) will disable back button cache. + | Livewire intelligently "morphs" existing HTML into the newly rendered HTML + | after each update. To make this process more reliable, Livewire injects + | "markers" into the rendered Blade surrounding @if, @class & @foreach. | */ - 'back_button_cache' => false, + 'inject_morph_markers' => true, /* - |-------------------------------------------------------------------------- - | Render On Redirect - |-------------------------------------------------------------------------- + |--------------------------------------------------------------------------- + | Pagination Theme + |--------------------------------------------------------------------------- | - | This value determines whether Livewire will render before it's redirected - | or not. Setting it to "false" (default) will mean the render method is - | skipped when redirecting. And "true" will mean the render method is - | run before redirecting. Browsers bfcache can store a potentially - | stale view if render is skipped on redirect. + | When enabling Livewire's pagination feature by using the `WithPagination` + | trait, Livewire will use Tailwind templates to render pagination views + | on the page. If you want Bootstrap CSS, you can specify: "bootstrap" | */ - 'render_on_redirect' => false, - + 'pagination_theme' => 'tailwind', ]; diff --git a/phpunit.xml b/phpunit.xml index 991a01e2..295262ed 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,29 +1,31 @@ - - - - ./tests/Unit - - - ./tests/Feature - - - - - - - - - - - - - - - - - - ./app - - + + + + tests/Unit + + + tests/Feature + + + + + app + + + + + + + + + + + + + diff --git a/resources/views/livewire/markdown-x.blade.php b/resources/views/livewire/markdown-x.blade.php index d0611bf5..48ce9926 100644 --- a/resources/views/livewire/markdown-x.blade.php +++ b/resources/views/livewire/markdown-x.blade.php @@ -1,46 +1,74 @@ -
-
- {{-- MarkdownX Toolbar --}} -
+
+
-
-
+
+
+
- - Saisi -
-
+ Saisi +
+
- - Preview -
-
+ Preview +
+
+ + + + Aide +
+
+
- -
- {{-- MarkdownX Editor --}} -
- -
+ +
-
-
-
-
-
-
+ x-on:click.away="popup=false" + wire:ignore + :class="{ 'translate-y-2 scale-100 transition-transform duration-100 ease-in-out': popup, 'translate-y-0 scale-95': !popup, 'max-w-sm' : popupType !== 'code', 'max-w-4xl pr-10' : popupType === 'code' }" + class="absolute z-40 w-full max-w-sm transform rounded-lg shadow-sm" + x-cloak + > +
+
+
+
+
+
-
-
-
-
- - - - - - - - -
-
-
-
- Cursor Start: - - Cursor End: - -
-
-
-
+
- Type '/' for commands +
+
+
+ + + + + + + + +
+
+
+
+ Cursor Start: + + Cursor End: + +
+
+
+
+ Type '/' for commands +
- + x-on:click="editorEvent($event)" + x-cloak + > -
-
- - - - - - - Drop Files Here + + + + + + + Drop Files Here +
-
- {{-- MarkdownX Preview Section --}} -
- {!! $contentPreview !!} -
- {{-- End: MarkdownX Preview Section --}} + {{-- MarkdownX Preview Section --}} +
+ {!! $contentPreview !!} +
+ {{-- End: MarkdownX Preview Section --}} - {{-- MarkdownX Help Section --}} -
-

Markdown Basics

-

- Below you will find some common used markdown syntax. For a deeper dive in Markdown check out this - - Cheat Sheet - -

-
- -

Bold & Italic

-

- Italics - *asterisks* -
- Bold - **double asterisks** -

-
- -

Code

-

- Inline Code -
- `backtick` - Code Block - + {{-- MarkdownX Help Section --}} +

+

Markdown Basics

+

+ Below you will find some common used markdown syntax. For a deeper dive in Markdown check out this + + Cheat Sheet + +

+
+ +

Bold & Italic

+

+ Italics + *asterisks* +
+ Bold + **double asterisks** +

+
+ +

Code

+

+ Inline Code +
+ `backtick` + Code Block + ```
Three back ticks and then enter your code blocks here.
```
-

-
- -

Headers

-

- # This is a Heading 1 -
- ## This is a Heading 2 -
- ### This is a Heading 3 -
-

-
- -

Quotes

-
> type a greater than sign and start typing your quote.
-
- -

Links

-

- You can add - links - by adding text inside of - [] - and the link inside of - () - , like so: -

-
[link_text](https://google.com)
-
- -

Lists

-

- To add a numbered list you can simply start with a number and a - . - , like so: -
- 1. The first item in my list -

-

- For an unordered list, you can add a dash - - - , like so: -
- - The start of my list -

-
- -

Images

-

- You can add images by selecting the image icon, which will upload and add an image to the editor, or you - can manually add the image by adding an exclamation - ! - , followed by the alt text inside of - [] - , and the image URL inside of - () - , like so: -

-
![alt text for image](url_to_image.png)
-
- -

Dividers

-

- To add a divider you can add three dashes or three asterisks: -
- --- or *** -

-
- - @if (in_array('giphy', config('markdownx.dropdown_items'))) -

Embedding GIFs via Giphy

-

- You can easily embed animated GIFS with the following syntax: -
- {% giphy https://giphy.com/embed/giphy_id %}


- @endif - @if (in_array('codepen', config('markdownx.dropdown_items'))) -

Embedding Codepens

+

Headers

- You can also embed a codepen by writing the following: + # This is a Heading 1 +
+ ## This is a Heading 2 +
+ ### This is a Heading 3
- {% codepen https://codepen.io/your/pen/url %} -

-

- You may also choose the default tabs you wish to show your pen by writing the - default-tab - like so: (default is result)

+
+ +

Quotes

+
> type a greater than sign and start typing your quote.
+
+ +

Links

- - {% codepen https://codepen.io/your/pen/url default-tab=result,html %} - + You can add + links + by adding text inside of + [] + and the link inside of + () + , like so:

+
[link_text](https://google.com)

- @endif - @if (in_array('codesandbox', config('markdownx.dropdown_items'))) -

Embedding CodeSandbox

+

Lists

- You can also embed CodeSandbox by writing the following: + To add a numbered list you can simply start with a number and a + . + , like so:
- {% codesandbox YOUR_CODESANDBOX_EMBED_URL %} + 1. The first item in my list

-
- @endif - - @if (in_array('gists', config('markdownx.dropdown_items'))) -

Embedding Gists

- You can also embed a Gists by writing the following: + For an unordered list, you can add a dash + - + , like so:
- {% gist GIST_ID_HERE %} + - The start of my list


- @endif - @if (in_array('youtube', config('markdownx.dropdown_items'))) -

Embedding YouTube Videos

+

Images

- You can also embed a YouTube video by writing the following: -
- {% youtube VIDEO_ID_HERE %} + You can add images by selecting the image icon, which will upload and add an image to the editor, or you + can manually add the image by adding an exclamation + ! + , followed by the alt text inside of + [] + , and the image URL inside of + () + , like so:

+
![alt text for image](url_to_image.png)

- @endif - @if (in_array('buy_me_a_coffee', config('markdownx.dropdown_items'))) -

Embedding buymeacoffee.com

+

Dividers

- You can also embed your "Buy me a coffee" button by writing the following: + To add a divider you can add three dashes or three asterisks:
+ --- or *** +

+
+ + @if (in_array('giphy', config('markdownx.dropdown_items'))) +

Embedding GIFs via Giphy

+

+ You can easily embed animated GIFS with the following syntax: +
+ {% giphy https://giphy.com/embed/giphy_id %} +

+
+ @endif + + @if (in_array('codepen', config('markdownx.dropdown_items'))) +

Embedding Codepens

+

+ You can also embed a codepen by writing the following: +
+ {% codepen https://codepen.io/your/pen/url %} +

+

+ You may also choose the default tabs you wish to show your pen by writing the + default-tab + like so: (default is result) +

+

+ {% codepen https://codepen.io/your/pen/url default-tab=result,html %} + +

+
+ @endif + + @if (in_array('codesandbox', config('markdownx.dropdown_items'))) +

Embedding CodeSandbox

+

+ You can also embed CodeSandbox by writing the following: +
+ {% codesandbox YOUR_CODESANDBOX_EMBED_URL %} +

+
+ @endif + + @if (in_array('gists', config('markdownx.dropdown_items'))) +

Embedding Gists

+

+ You can also embed a Gists by writing the following: +
+ {% gist GIST_ID_HERE %} +

+
+ @endif + + @if (in_array('youtube', config('markdownx.dropdown_items'))) +

Embedding YouTube Videos

+

+ You can also embed a YouTube video by writing the following: +
+ {% youtube VIDEO_ID_HERE %} +

+
+ @endif + + @if (in_array('buy_me_a_coffee', config('markdownx.dropdown_items'))) +

Embedding buymeacoffee.com

+

+ You can also embed your "Buy me a coffee" button by writing the following: +
+ {% buymeacoffee BUY_ME_A_COFFEE_USERNAME_HERE %} -

-
- @endif +

+
+ @endif +
+ {{-- End: MarkdownX Help Section --}}
- {{-- End: MarkdownX Help Section --}} -
- + /********** END TEXT AREA PROTOTYPES **********/ + +
diff --git a/src/Domain/Forum/.gitkeep b/src/Domain/Forum/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/Domain/Job/.gitkeep b/src/Domain/Job/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/Domain/Profile/.gitkeep b/src/Domain/Profile/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/Domain/Sponsor/.gitkeep b/src/Domain/Sponsor/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/Domain/Subscription/.gitkeep b/src/Domain/Subscription/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/Infrastructure/.gitkeep b/src/Infrastructure/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index 361c1c62..b2b52cc8 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -5,15 +5,11 @@ namespace Tests; use Illuminate\Contracts\Console\Kernel; +use Illuminate\Foundation\Application; trait CreatesApplication { - /** - * Creates the application. - * - * @return \Illuminate\Foundation\Application - */ - public function createApplication() + public function createApplication(): Application { $app = require __DIR__.'/../bootstrap/app.php'; diff --git a/src/Domain/Enterprise/.gitkeep b/tests/Feature/Actions/.gitkeep similarity index 100% rename from src/Domain/Enterprise/.gitkeep rename to tests/Feature/Actions/.gitkeep diff --git a/tests/Feature/Actions/Discussion/CreateDiscussionActionTest.php b/tests/Feature/Actions/Discussion/CreateDiscussionActionTest.php new file mode 100644 index 00000000..39e8574f --- /dev/null +++ b/tests/Feature/Actions/Discussion/CreateDiscussionActionTest.php @@ -0,0 +1,50 @@ +user = $this->login(); + $this->tagOne = Tag::factory()->create(['name' => 'Tag 1', 'concerns' => ['discussion']]); + $this->tagTwo = Tag::factory()->create(['name' => 'Tag 2', 'concerns' => ['discussion', 'post']]); +}); + +describe(CreateDiscussionAction::class, function (): void { + it('return the created discussion', function (): void { + $discussionData = CreateDiscussionData::from([ + 'title' => 'Discussion title', + 'body' => 'Discussion body', + 'tags' => [], + ]); + + $discussion = app(CreateDiscussionAction::class)->execute($discussionData); + + expect($discussion) + ->toBeInstanceOf(Discussion::class) + ->and($discussion->tags) + ->toHaveCount(0) + ->and($discussion->user_id) + ->toBe($this->user->id); + }); + + it('return the created discussion with associate tags', function (): void { + $discussionData = CreateDiscussionData::from([ + 'title' => 'Discussion with associate tags', + 'body' => 'Discussion body for the tags', + 'tags' => [$this->tagOne->id, $this->tagTwo->id], + ]); + + $discussion = app(CreateDiscussionAction::class)->execute($discussionData); + + expect($discussion) + ->toBeInstanceOf(Discussion::class) + ->and($discussion->tags) + ->toHaveCount(2) + ->and($discussion->user_id) + ->toBe($this->user->id); + }); +})->group('Discussions'); diff --git a/tests/Feature/Livewire/DiscussionTest.php b/tests/Feature/Livewire/DiscussionTest.php new file mode 100644 index 00000000..a98f3721 --- /dev/null +++ b/tests/Feature/Livewire/DiscussionTest.php @@ -0,0 +1,32 @@ +user = $this->login(); +}); + +describe(Create::class, function (): void { + it('should save a discussion and send Telegram notification', function (): void { + Livewire::test(Create::class) + ->set('title', 'My Discussion') + ->set('body', '## My Discussion content') + ->call('store'); + + expect(Discussion::count()) + ->toBe(1); + + Notification::assertSentTo( + notifiable: $this->user, + notification: PostDiscussionToTelegram::class + ); + + Notification::assertCount(1); + }); +}); diff --git a/tests/TestCase.php b/tests/TestCase.php index 45ec4c8e..dab304ad 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -5,9 +5,20 @@ namespace Tests; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; +use Illuminate\Support\Facades\Artisan; +use Illuminate\Support\Facades\Notification; abstract class TestCase extends BaseTestCase { use CreatesApplication; use CreatesUsers; + + protected function setUp(): void + { + parent::setUp(); + + Artisan::call('config:clear'); + + Notification::fake(); + } } From b0ffba18774b9263ca815cff6ce3111e8189e48a Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Mon, 7 Oct 2024 22:37:31 +0200 Subject: [PATCH 2/2] fix: app env key on phpunit.xml --- phpunit.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml b/phpunit.xml index 295262ed..6f5105b4 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -19,6 +19,7 @@ +