Skip to content

Commit

Permalink
Merge pull request #281 from spatie/livewire-v3
Browse files Browse the repository at this point in the history
Livewire v3
  • Loading branch information
Nielsvanpach authored Oct 31, 2023
2 parents 21756bf + 2152c8f commit a56ca92
Show file tree
Hide file tree
Showing 42 changed files with 2,215 additions and 1,697 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none

- name: Install composer dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: main

Expand Down
19 changes: 0 additions & 19 deletions app/Domain/Experience/ExperienceAggregateRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use App\Domain\Experience\Commands\DeleteUser;
use App\Domain\Experience\Commands\RegisterPullRequest;
use App\Domain\Experience\Commands\RegisterSeriesCompletion;
use App\Domain\Experience\Commands\RegisterVideoCompletion;
use App\Domain\Experience\Commands\UnlockAchievement;
use App\Domain\Experience\Events\AchievementUnlocked;
use App\Domain\Experience\Events\ExperienceEarned;
Expand All @@ -16,7 +15,6 @@
use App\Domain\Experience\Events\VideoCompleted;
use App\Models\Series;
use App\Models\User;
use App\Models\Video;
use Exception;
use Spatie\EventSourcing\AggregateRoots\AggregateRoot;

Expand Down Expand Up @@ -81,23 +79,6 @@ protected function applyPullRequestMerged(PullRequestMerged $event): void
$this->mergedPullRequests[$event->reference] = true;
}

public function registerVideoCompletion(RegisterVideoCompletion $command): self
{
if ($this->completedVideos[$command->videoId] ?? false) {
return $this;
}

$video = Video::query()->findOrFail($command->videoId);

$this->recordThat(new VideoCompleted(
userId: $command->userId,
videoId: $command->videoId,
seriesId: $video->series_id,
));

return $this;
}

protected function applyVideoCompletion(VideoCompleted $event): void
{
$this->completedVideos[$event->videoId] = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use App\Domain\Shop\Models\License;
use Livewire\Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use App\Domain\Shop\Models\License;
use Livewire\Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use App\Models\Lesson;
use Livewire\Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use App\Models\Repository;
use Illuminate\Support\Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use App\Support\Search\DocsVersion;
use Illuminate\Support\Collection;
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function canImpersonate(): bool
public function hasCompleted(Series $series): bool
{
return Video::query()
->where('series_id', $series->id)
//->where('series_id', $series->id)
->whereDoesntHave('completions', function (Builder|LessonCompletion $builder) {
return $builder->where('user_id', $this->id);
})
Expand Down
10 changes: 5 additions & 5 deletions app/Providers/LivewireServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Providers;

use App\Http\Livewire\ActivationsComponent;
use App\Http\Livewire\DomainComponent;
use App\Http\Livewire\LessonCompletedButtonComponent;
use App\Http\Livewire\RepositoriesComponent;
use App\Http\Livewire\SearchDocsComponent;
use App\Livewire\ActivationsComponent;
use App\Livewire\DomainComponent;
use App\Livewire\LessonCompletedButtonComponent;
use App\Livewire\RepositoriesComponent;
use App\Livewire\SearchDocsComponent;
use Illuminate\Support\ServiceProvider;
use Livewire\Livewire;

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"barryvdh/laravel-debugbar": "^3.8",
"blade-ui-kit/blade-ui-kit": "^0.4",
"blendbyte/nova-items-field": "^1.0",
"coroowicaksono/chart-js-integration": "^0.3.5",
"coroowicaksono/chart-js-integration": "^0.4",
"doctrine/dbal": "^3.5.1",
"ebess/advanced-nova-media-library": "dev-master as 4.0.5",
"geoip2/geoip2": "^2.13",
Expand All @@ -38,7 +38,7 @@
"laravel/ui": "^4.2",
"league/commonmark": "^2.2.1",
"league/flysystem-aws-s3-v3": "^3.10",
"livewire/livewire": "^2.11",
"livewire/livewire": "^3.0",
"meilisearch/meilisearch-php": "^1.0",
"myclabs/php-enum": "^1.8.4",
"nyholm/psr7": "^1.5.1",
Expand All @@ -55,7 +55,7 @@
"spatie/laravel-artisan-dispatchable": "^1.3",
"spatie/laravel-backup": "^8.1.5",
"spatie/laravel-comments": "^1.3",
"spatie/laravel-comments-livewire": "^1.2.8",
"spatie/laravel-comments-livewire": "^2.0",
"spatie/laravel-enum": "^3.0.1",
"spatie/laravel-event-sourcing": "^7.3",
"spatie/laravel-feed": "^4.2",
Expand Down Expand Up @@ -86,7 +86,7 @@
"symfony/postmark-mailer": "^6.2",
"symfony/process": "^6.2",
"torann/geoip": "^3.0.4",
"wire-elements/spotlight": "^1.0"
"wire-elements/spotlight": "^2.0"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.13",
Expand Down
Loading

0 comments on commit a56ca92

Please sign in to comment.