Skip to content

Commit 5002bad

Browse files
committed
Merge branch 'main' into feat/1173-implement-fallback-article-images
2 parents 7faf8a7 + cd89b93 commit 5002bad

32 files changed

+1496
-749
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ updates:
44
directory: "/"
55
schedule:
66
interval: weekly
7-
day: wednesday
7+
day: friday
88
groups:
99
php-dependencies:
1010
update-types:
@@ -18,7 +18,7 @@ updates:
1818
directory: "/"
1919
schedule:
2020
interval: weekly
21-
day: wednesday
21+
day: friday
2222
groups:
2323
js-dependencies:
2424
update-types:

.github/workflows/tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
48

59
jobs:
610
tests:

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ We'd like to thank these **amazing companies** for sponsoring us. If you are int
2424
- [Envoyer](https://envoyer.io)
2525
- [Fathom](https://usefathom.com)
2626
- [Tinkerwell](https://tinkerwell.app)
27-
- [Skynet Technologies](https://www.skynettechnologies.com/hire-laravel-developer)
2827
- [BairesDev](https://www.bairesdev.com/sponsoring-open-source-projects/)
29-
- [Remotely Works](https://www.remotely.works/sponsoring-open-source-projects)
3028
- [Dotcom-monitor](https://www.dotcom-monitor.com/sponsoring-open-source-projects/)
29+
- [N-iX](https://www.n-ix.com/)
3130

3231
## Requirements
3332

@@ -94,9 +93,9 @@ New threads will be automatically added to the index and threads which get updat
9493
php artisan scout:flush App\\Models\\Thread
9594
```
9695

97-
### Twitter Sharing (optional)
96+
### X (Twitter) Sharing (optional)
9897

99-
To enable published articles to be automatically shared on Twitter, you'll need to [create a Twitter app](https://developer.twitter.com/apps/). Once the app has been created, update the below variables in your `.env` file. The consumer key and secret and access token and secret can be found in the `Keys and tokens` section of the Twitter developers UI.
98+
To enable published articles to be automatically shared on X, you'll need to [create an app](https://developer.x.com/apps/). Once the app has been created, update the below variables in your `.env` file. The consumer key and secret and access token and secret can be found in the `Keys and tokens` section of the X developers UI.
10099

101100
```
102101
TWITTER_CONSUMER_KEY=

app/Console/Commands/PostArticleToTwitter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final class PostArticleToTwitter extends Command
1111
{
1212
protected $signature = 'lio:post-article-to-twitter';
1313

14-
protected $description = 'Posts the latest unshared article to Twitter';
14+
protected $description = 'Posts the latest unshared article to X';
1515

1616
public function handle(AnonymousNotifiable $notifiable): void
1717
{

app/Http/Controllers/Admin/UsersController.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use App\Http\Requests\BanRequest;
88
use App\Jobs\BanUser;
99
use App\Jobs\DeleteUser;
10+
use App\Jobs\DeleteUserThreads;
1011
use App\Jobs\UnbanUser;
1112
use App\Models\User;
1213
use App\Policies\UserPolicy;
@@ -39,6 +40,10 @@ public function ban(BanRequest $request, User $user): RedirectResponse
3940

4041
$this->dispatchSync(new BanUser($user, $request->get('reason')));
4142

43+
if ($request->willDeleteThreads()) {
44+
$this->dispatchSync(new DeleteUserThreads($user));
45+
}
46+
4247
$this->success($user->name().' was banned!');
4348

4449
return redirect()->route('profile', $user->username());
@@ -65,4 +70,15 @@ public function delete(User $user): RedirectResponse
6570

6671
return redirect()->route('admin.users');
6772
}
73+
74+
public function deleteThreads(User $user): RedirectResponse
75+
{
76+
$this->authorize(UserPolicy::DELETE, $user);
77+
78+
$this->dispatchSync(new DeleteUserThreads($user));
79+
80+
$this->success($user->name().' threads were deleted!');
81+
82+
return redirect()->route('admin.users');
83+
}
6884
}

app/Http/Requests/BanRequest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ public function rules(): array
1515
{
1616
return [
1717
'reason' => 'required|string',
18+
'delete_threads' => 'boolean',
1819
];
1920
}
2021

2122
public function reason(): string
2223
{
2324
return $this->get('reason');
2425
}
26+
27+
public function willDeleteThreads(): bool
28+
{
29+
return $this->boolean('delete_threads');
30+
}
2531
}

app/Jobs/DeleteUserThreads.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace App\Jobs;
4+
5+
use App\Models\User;
6+
7+
final class DeleteUserThreads
8+
{
9+
public function __construct(private User $user) {}
10+
11+
public function handle(): void
12+
{
13+
$this->user->deleteThreads();
14+
}
15+
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"algolia/scout-extended": "^3.1",
99
"blade-ui-kit/blade-heroicons": "^2.3",
1010
"blade-ui-kit/blade-icons": "^1.6",
11-
"blade-ui-kit/blade-ui-kit": "^0.6",
11+
"blade-ui-kit/blade-ui-kit": "^0.6.3",
1212
"blade-ui-kit/blade-zondicons": "^1.5",
1313
"codeat3/blade-simple-icons": "^5.0",
1414
"guzzlehttp/guzzle": "^7.2",

0 commit comments

Comments
 (0)