diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7ceed2af7..87a288177 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ We very much appreciate any help with [open issues labeled with "help wanted"](h - It's a good practice to write tests for your contribution - Write the full namespace in DocBlocks for `@param`, `@var` or `@return` tags -- The rest of the coding standards will automatically fixed by [Github Actions](https://github.com/laravelio/laravel.io/actions) +- The rest of the coding standards will automatically be fixed by [GitHub Actions](https://github.com/laravelio/laravel.io/actions) ## Testing diff --git a/README.md b/README.md index 2b4b13853..060e69440 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This is the repository for the [Laravel.io](http://laravel.io) community portal. ## Sponsors -We'd like to thank these **amazing companies** for sponsoring us. If you are interested in becoming a sponsor, please visit the Laravel.io Github Sponsors page. +We'd like to thank these **amazing companies** for sponsoring us. If you are interested in becoming a sponsor, please visit the Laravel.io GitHub Sponsors page. - **[Eventy](https://https://eventy.io/?utm_source=Laravel.io&utm_campaign=eventy&utm_medium=advertisement)** - [Forge](https://forge.laravel.com) @@ -54,9 +54,9 @@ The following tools are required in order to start the installation. You can now visit the app in your browser by visiting [http://laravel.io.test](http://laravel.io.test). If you seeded the database you can login into a test account with **`testing`** & **`password`**. -### Github Authentication (optional) +### GitHub Authentication (optional) -To get Github authentication to work locally, you'll need to [register a new OAuth application on Github](https://github.com/settings/applications/new). Use `http://laravel.io.test` for the homepage url and `http://laravel.io.test/auth/github` for the callback url. When you've created the app, fill in the ID and secret in your `.env` file in the env variables below. You should now be able to authentication with Github. +To get GitHub authentication to work locally, you'll need to [register a new OAuth application on GitHub](https://github.com/settings/applications/new). Use `http://laravel.io.test` for the homepage url and `http://laravel.io.test/auth/github` for the callback url. When you've created the app, fill in the ID and secret in your `.env` file in the env variables below. You should now be able to authentication with GitHub. ``` GITHUB_ID= @@ -66,7 +66,7 @@ GITHUB_URL=http://laravel.io.test/auth/github ### Algolia Search (optional) -To get Algolia search running locally, you'll need to [register for a new account](https://www.algolia.com/users/sign_up) and create an index called `threads`. Algolia has a free tier that satisfies all of the requirements needed for a development environment. Now update the below variables in your `.env` file. The App ID and secret keys can be found in the `API Keys` section of the Algoila UI. +To get Algolia search running locally, you'll need to [register for a new account](https://www.algolia.com/users/sign_up) and create an index called `threads`. Algolia has a free tier that satisfies all of the requirements needed for a development environment. Now update the below variables in your `.env` file. The App ID and secret keys can be found in the `API Keys` section of the Algoila UI. ``` SCOUT_DRIVER=algolia @@ -94,7 +94,7 @@ php artisan scout:flush App\\Models\\Thread ### Twitter Sharing (optional) -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. +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. ``` TWITTER_CONSUMER_KEY= diff --git a/app/Http/Controllers/Auth/GithubController.php b/app/Http/Controllers/Auth/GitHubController.php similarity index 86% rename from app/Http/Controllers/Auth/GithubController.php rename to app/Http/Controllers/Auth/GitHubController.php index c4abc1ea3..6774a2ea0 100644 --- a/app/Http/Controllers/Auth/GithubController.php +++ b/app/Http/Controllers/Auth/GitHubController.php @@ -5,7 +5,7 @@ use App\Http\Controllers\Controller; use App\Jobs\UpdateProfile; use App\Models\User; -use App\Social\GithubUser; +use App\Social\GitHubUser; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Facades\Auth; @@ -13,7 +13,7 @@ use Laravel\Socialite\Two\InvalidStateException; use Laravel\Socialite\Two\User as SocialiteUser; -class GithubController extends Controller +class GitHubController extends Controller { /** * Redirect the user to the GitHub authentication page. @@ -37,9 +37,9 @@ public function handleProviderCallback() } try { - $user = User::findByGithubId($socialiteUser->getId()); + $user = User::findByGitHubId($socialiteUser->getId()); } catch (ModelNotFoundException $exception) { - return $this->userNotFound(new GithubUser($socialiteUser->getRaw())); + return $this->userNotFound(new GitHubUser($socialiteUser->getRaw())); } return $this->userFound($user, $socialiteUser); @@ -59,7 +59,7 @@ private function userFound(User $user, SocialiteUser $socialiteUser): RedirectRe return redirect()->route('profile'); } - private function userNotFound(GithubUser $user): RedirectResponse + private function userNotFound(GitHubUser $user): RedirectResponse { if ($user->isTooYoung()) { $this->error('errors.github_account_too_young'); @@ -76,7 +76,7 @@ private function userNotFound(GithubUser $user): RedirectResponse return $this->redirectUserToRegistrationPage($user); } - private function redirectUserToRegistrationPage(GithubUser $user): RedirectResponse + private function redirectUserToRegistrationPage(GitHubUser $user): RedirectResponse { session(['githubData' => $user->toArray()]); diff --git a/app/Models/User.php b/app/Models/User.php index b9b2adb45..36d033e16 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -252,7 +252,7 @@ public static function findByEmailAddress(string $emailAddress): self return self::where('email', $emailAddress)->firstOrFail(); } - public static function findByGithubId(string $githubId): self + public static function findByGitHubId(string $githubId): self { return self::where('github_id', $githubId)->firstOrFail(); } diff --git a/app/Rules/UniqueGitHubUser.php b/app/Rules/UniqueGitHubUser.php index e326d2d65..210b010d1 100644 --- a/app/Rules/UniqueGitHubUser.php +++ b/app/Rules/UniqueGitHubUser.php @@ -16,7 +16,7 @@ final class UniqueGitHubUser implements Rule public function passes($attribute, $value): bool { try { - $this->user = User::findByGithubId($value); + $this->user = User::findByGitHubId($value); } catch (ModelNotFoundException) { return true; } diff --git a/app/Social/GithubUser.php b/app/Social/GitHubUser.php similarity index 95% rename from app/Social/GithubUser.php rename to app/Social/GitHubUser.php index 15ac9d15c..3bf63fdd2 100644 --- a/app/Social/GithubUser.php +++ b/app/Social/GitHubUser.php @@ -6,7 +6,7 @@ use Illuminate\Contracts\Support\Arrayable; use Illuminate\Support\Arr; -final class GithubUser implements Arrayable +final class GitHubUser implements Arrayable { public function __construct( private array $attributes diff --git a/lang/en/errors.php b/lang/en/errors.php index 8f3f31cc0..11836c143 100644 --- a/lang/en/errors.php +++ b/lang/en/errors.php @@ -4,7 +4,7 @@ 'banned' => 'This account is banned.', 'fields' => 'Something went wrong. Please review the fields below.', 'github_invalid_state' => 'The request timed out. Please try again.', - 'github_account_too_young' => 'Your Github account needs to be older than 2 weeks in order to register.', - 'github_account_no_repositories' => 'Your Github account needs to have at least 1 public repository in order to register.', + 'github_account_too_young' => 'Your GitHub account needs to be older than 2 weeks in order to register.', + 'github_account_no_repositories' => 'Your GitHub account needs to have at least 1 public repository in order to register.', 'github_account_exists' => 'We already found a user with the given GitHub account (:username). Would you like to login instead?', ]; diff --git a/resources/views/errors/500.blade.php b/resources/views/errors/500.blade.php index ad87728c8..6563eae08 100644 --- a/resources/views/errors/500.blade.php +++ b/resources/views/errors/500.blade.php @@ -7,7 +7,7 @@

{{ $title }}

We've been notified and will try to fix the problem as soon as possible.
- Please open a Github issue if the problem persists. + Please open a GitHub issue if the problem persists.

@endsection diff --git a/resources/views/layouts/_nav.blade.php b/resources/views/layouts/_nav.blade.php index c1d55b32d..ccfacf682 100644 --- a/resources/views/layouts/_nav.blade.php +++ b/resources/views/layouts/_nav.blade.php @@ -92,7 +92,7 @@
  • - Github + GitHub
  • diff --git a/routes/web.php b/routes/web.php index 0beadc365..d5689cd96 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6,7 +6,7 @@ use App\Http\Controllers\Articles\ArticlesController; use App\Http\Controllers\Articles\AuthoredArticles; use App\Http\Controllers\Auth\ForgotPasswordController; -use App\Http\Controllers\Auth\GithubController; +use App\Http\Controllers\Auth\GitHubController; use App\Http\Controllers\Auth\LoginController; use App\Http\Controllers\Auth\RegisterController; use App\Http\Controllers\Auth\ResetPasswordController; @@ -62,8 +62,8 @@ Route::post('email/resend', [VerificationController::class, 'resend'])->name('verification.resend'); // Social authentication -Route::get('login/github', [GithubController::class, 'redirectToProvider'])->name('login.github'); -Route::get('auth/github', [GithubController::class, 'handleProviderCallback']); +Route::get('login/github', [GitHubController::class, 'redirectToProvider'])->name('login.github'); +Route::get('auth/github', [GitHubController::class, 'handleProviderCallback']); // Users Route::redirect('/dashboard', '/user'); diff --git a/tests/Unit/Social/GithubUserTest.php b/tests/Unit/Social/GitHubUserTest.php similarity index 70% rename from tests/Unit/Social/GithubUserTest.php rename to tests/Unit/Social/GitHubUserTest.php index 191423297..ffed64af6 100644 --- a/tests/Unit/Social/GithubUserTest.php +++ b/tests/Unit/Social/GitHubUserTest.php @@ -1,22 +1,22 @@ Carbon::now()->subWeeks(3)]); + $user = new GitHubUser(['created_at' => Carbon::now()->subWeeks(3)]); expect($user->isTooYoung())->toBeFalse(); }); it('can determine if the user is younger than two weeks', function () { - $user = new GithubUser(['created_at' => Carbon::now()->subWeek()]); + $user = new GitHubUser(['created_at' => Carbon::now()->subWeek()]); expect($user->isTooYoung())->toBeTrue(); }); it('can determine if the user has public repositories', function (int $numberOfRepos, bool $expected) { - $user = new GithubUser(['public_repos' => $numberOfRepos]); + $user = new GitHubUser(['public_repos' => $numberOfRepos]); expect($user->hasPublicRepositories())->toBe($expected); })->with([