Skip to content

Commit cd89b93

Browse files
REFACTOR - Twitter to X (Twitter) and twitter.com to x.com (#1170)
* REFACTOR - Twitter to X (Twitter) and twitter.com to x.com * FIX - Tests * wip * wip --------- Co-authored-by: Dries Vints <[email protected]>
1 parent 918d09f commit cd89b93

File tree

18 files changed

+113
-114
lines changed

18 files changed

+113
-114
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ New threads will be automatically added to the index and threads which get updat
9393
php artisan scout:flush App\\Models\\Thread
9494
```
9595

96-
### Twitter Sharing (optional)
96+
### X (Twitter) Sharing (optional)
9797

98-
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.
9999

100100
```
101101
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
{

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",

composer.lock

Lines changed: 78 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/views/articles/overview.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<h2 class="text-2xl font-extrabold tracking-tight text-gray-900 md:text-3xl">
1616
<span class="block">Got some knowledge to share?</span>
1717
<span class="block">
18-
Share your article with <a href="https://twitter.com/laravelio" class="text-lio-500 hover:text-lio-600 hover:underline">our 50,000+ Twitter followers</a>.
18+
Share your article with <a href="https://x.com/laravelio" class="text-lio-500 hover:text-lio-600 hover:underline">our 50,000+ X (Twitter) followers</a>.
1919
</span>
2020
</h2>
2121
<div class="mt-8 flex lg:mt-0 lg:shrink-0">

resources/views/articles/show.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class="prose prose-lg text-gray-800 prose-lio"
158158
@endif
159159

160160
@if ($article->author()->hasTwitterAccount())
161-
<a href="https://twitter.com/{{ $article->author()->twitter() }}" class="text-twitter">
161+
<a href="https://x.com/{{ $article->author()->twitter() }}" class="text-twitter">
162162
<x-si-x class="w-6 h-6" />
163163
</a>
164164
@endif

resources/views/auth/passwords/reset.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
</div>
1414

1515
<div>
16-
<x-forms.label for="password" />
16+
<x-forms.label for="password">New Password</x-forms.label>
1717

1818
<x-forms.inputs.password name="password" id="password" required />
1919
</div>
2020

2121
<div>
22-
<x-forms.label for="password_confirmation" />
22+
<x-forms.label for="password_confirmation">Confirm New Password</x-forms.label>
2323

2424
<x-forms.inputs.password name="password_confirmation" id="password_confirmation" required />
2525
</div>

resources/views/components/articles/engage.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<span class="uppercase text-gray-500">Share</span>
77

88
<a class="text-gray-300 hover:text-twitter" target="_blank" rel="noopener" aria-label="Share on Twitter"
9-
href="http://twitter.com/share?text={{ urlencode('"'.$article->title().'" by '. ($article->author()->twitter() ? '@'.$article->author()->twitter() : $article->author()->name()) . ' - ') }}&url={{ urlencode(route('articles.show', $article->slug())) }}">
9+
href="http://x.com/share?text={{ urlencode('"'.$article->title().'" by '. ($article->author()->twitter() ? '@'.$article->author()->twitter() : $article->author()->name()) . ' - ') }}&url={{ urlencode(route('articles.show', $article->slug())) }}">
1010
<x-si-x class="w-6 h-6" />
1111
</a>
1212

resources/views/components/articles/form.blade.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</x-info>
2626

2727
<x-info class="mt-4">
28-
Every article that gets approved will be shared with our 50.000 users and wil be tweeted out on our <a href="https://twitter.com/laravelio" class="text-lio-700 underline">Twitter account</a> which has over 50,000 followers. Feel free to submit as many articles as you like. You can even cross-reference an article on your blog with the original url.
28+
Every article that gets approved will be shared with our 50.000 users and wil be tweeted out on our <a href="https://x.com/laravelio" class="text-lio-700 underline">X (Twitter) account</a> which has over 50,000 followers. Feel free to submit as many articles as you like. You can even cross-reference an article on your blog with the original url.
2929
</x-info>
3030

3131
<x-info class="mt-4">
@@ -38,7 +38,7 @@
3838
<div class="flex flex-col space-y-6">
3939
<div class="grow space-y-6">
4040
<div class="space-y-1">
41-
<x-forms.label for="title">Title</x-forms.label>
41+
<x-forms.label for="title" />
4242

4343
<x-forms.inputs.input name="title" :value="old('title', $article?->title())" required maxlength="100" />
4444

@@ -50,7 +50,7 @@
5050

5151
<div class="grow space-y-6">
5252
<div class="space-y-1">
53-
<x-forms.label for="body">Body</x-forms.label>
53+
<x-forms.label for="body" />
5454

5555
<livewire:editor :body="$article?->body()"/>
5656

@@ -73,7 +73,7 @@
7373

7474
<div class="grow space-y-6">
7575
<div class="space-y-1">
76-
<x-forms.label for="tags">Tags</x-forms.label>
76+
<x-forms.label for="tags" />
7777

7878
<select name="tags[]" id="create-article" multiple x-data="{}" x-init="$nextTick(function () { choices($el) })">
7979
@foreach ($tags as $tag)
@@ -148,9 +148,8 @@ class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:t
148148

149149
@unless (Auth::user()->twitter())
150150
<span class="text-gray-600 text-sm mt-4 block">
151-
Articles will be shared on Twitter.
152-
<a href="{{ route('settings.profile') }}" class="text-green-darker">Add your Twitter handle</a>
153-
and we'll include that too.
151+
Articles will be shared on X (Twitter).
152+
<a href="{{ route('settings.profile') }}" class="text-green-darker">Add your X (Twitter) handle</a> and we'll include that too.
154153
</span>
155154
@endunless
156155
</div>

resources/views/components/threads/form.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<div class="flex flex-col space-y-6">
3333
<div class="grow space-y-6">
3434
<div class="space-y-1">
35-
<x-forms.label for="subject"/>
35+
<x-forms.label for="subject" />
3636

3737
<x-forms.inputs.input name="subject" :value="$thread?->subject()" required maxlength="60" />
3838

@@ -44,9 +44,7 @@
4444

4545
<div class="grow space-y-6">
4646
<div class="space-y-1">
47-
<x-forms.label for="tags">
48-
Tags
49-
</x-forms.label>
47+
<x-forms.label for="tags" />
5048

5149
<select name="tags[]" id="create-thread" multiple x-data="{}" x-init="$nextTick(function () { choices($el) })">
5250
@foreach($tags as $tag)
@@ -58,7 +56,9 @@
5856

5957
<div class="grow space-y-6">
6058
<div class="space-y-1">
61-
<x-forms.label for="body">Compose your question</x-forms.label>
59+
<x-forms.label for="body">
60+
Compose your question
61+
</x-forms.label>
6262

6363
<livewire:editor
6464
:body="$thread?->body()"

resources/views/components/users/profile-block.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@endif
2424

2525
@if ($user->hasTwitterAccount())
26-
<a href="https://twitter.com/{{ $user->twitter() }}" class="text-twitter">
26+
<a href="https://x.com/{{ $user->twitter() }}" class="text-twitter">
2727
<x-si-x class="w-6 h-6" />
2828
</a>
2929
@endif

resources/views/layouts/_footer.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
</p>
4242

4343
<div class="flex flex-wrap lg:flex-col lg:flex-no-wrap">
44-
<a href="https://twitter.com/laravelio" class="w-1/2 text-gray-400 mb-4 hover:text-gray-200 lg:mb-6 whitespace-nowrap">
44+
<a href="https://x.com/laravelio" class="w-1/2 text-gray-400 mb-4 hover:text-gray-200 lg:mb-6 whitespace-nowrap">
4545
<x-si-x class="text-white w-4 h-4 inline mr-2"/>
46-
Twitter
46+
(Twitter)
4747
</a>
4848

4949
<a href="https://github.com/laravelio" class="w-1/2 text-gray-400 mb-4 hover:text-gray-200 lg:mb-6 whitespace-nowrap">

resources/views/layouts/_nav.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<x-icon-github class="w-6 h-6 inline"/>
1414
</a>
1515

16-
<a href="https://twitter.com/laravelio" class="inline-block">
16+
<a href="https://x.com/laravelio" class="inline-block">
1717
<x-si-x class="w-6 h-6 inline text-twitter"/>
1818
</a>
1919

@@ -145,7 +145,7 @@
145145
<x-icon-github class="w-5 h-5 inline"/>
146146
</a>
147147

148-
<a href="https://twitter.com/laravelio" class="hidden lg:inline-block">
148+
<a href="https://x.com/laravelio" class="hidden lg:inline-block">
149149
<x-si-x class="w-5 h-5 inline text-twitter"/>
150150
</a>
151151

resources/views/users/articles.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div class="container mx-auto px-4 py-8">
2323
@unless(Auth::user()->hasTwitterAccount())
2424
<x-primary-info-panel icon="heroicon-s-information-circle">
25-
Set your <a href="{{ route('settings.profile') }}" class="underline">Twitter handle</a> so we can link to your profile when we tweet out your article.
25+
Set your <a href="{{ route('settings.profile') }}" class="underline">X (Twitter) handle</a> so we can link to your profile when we tweet out your article.
2626
</x-primary-info-panel>
2727
@endunless
2828

resources/views/users/profile.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class="w-full bg-center bg-gray-800 h-60 container mx-auto"
4747
@endif
4848

4949
@if ($user->hasTwitterAccount())
50-
<a href="https://twitter.com/{{ $user->twitter() }}" class="text-twitter">
50+
<a href="https://x.com/{{ $user->twitter() }}" class="text-twitter">
5151
<x-si-x class="w-6 h-6" />
5252
</a>
5353
@endif

resources/views/users/settings/api_tokens.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
<div>
4141
<div class="col-span-12">
42-
<x-forms.label for="token_name">Token name</x-forms.label>
42+
<x-forms.label for="token_name" />
4343

4444
<x-forms.inputs.input name="token_name" form="api_token_settings_form" required />
4545
</div>

resources/views/users/settings/profile.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
<div class="flex flex-col space-y-6 lg:flex-row lg:space-y-0 lg:space-x-6">
1717
<div class="grow space-y-6">
1818
<div class="space-y-1">
19-
<x-forms.label for="name"/>
19+
<x-forms.label for="name" />
2020

2121
<x-forms.inputs.input name="name" :value="Auth::user()->name()" required />
2222
</div>
2323

2424
<div class="space-y-1">
25-
<x-forms.label for="bio"/>
25+
<x-forms.label for="bio" />
2626

2727
<x-forms.inputs.textarea name="bio" maxlength="160">
2828
{{ Auth::user()->bio() }}
@@ -79,18 +79,18 @@
7979
</div>
8080

8181
<div class="col-span-12 sm:col-span-6">
82-
<x-forms.label for="website">Website</x-forms.label>
82+
<x-forms.label for="website" />
8383

8484
<x-forms.inputs.input name="website" :value="Auth::user()->website()" prefix-icon="heroicon-o-globe-alt" />
8585
</div>
8686

8787
<div class="col-span-12 sm:col-span-6">
88-
<x-forms.label for="twitter">Twitter handle</x-forms.label>
88+
<x-forms.label for="twitter">X (Twitter) handle</x-forms.label>
8989

9090
<x-forms.inputs.input name="twitter" :value="Auth::user()->twitter()" prefix-icon="heroicon-o-at-symbol" class="nav-search" />
9191

9292
<span class="mt-2 text-sm text-gray-500">
93-
Enter your Twitter handle without the leading @ symbol
93+
Enter your X (Twitter) handle without the leading @ symbol
9494
</span>
9595
</div>
9696
</div>

tests/Feature/ArticleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,15 +489,15 @@
489489
$this->login(['twitter' => null]);
490490

491491
$this->get('/articles/authored')
492-
->assertSeeText('Twitter handle', '<a>')
492+
->assertSeeText('X (Twitter) handle', '<a>')
493493
->assertSee('so we can link to your profile when we tweet out your article.');
494494
});
495495

496496
test('user do not see tip if they have set the twitter handle', function () {
497497
$this->login();
498498

499499
$this->get('/articles/authored')
500-
->assertDontSeeText('Twitter handle', '<a>')
500+
->assertDontSeeText('X (Twitter) handle', '<a>')
501501
->assertDontSee('so we can link to your profile when we tweet out your article.');
502502
});
503503

0 commit comments

Comments
 (0)