Skip to content

Commit 08727ae

Browse files
committed
Merge everything
2 parents 542320e + bc60080 commit 08727ae

File tree

437 files changed

+3625
-3951
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

437 files changed

+3625
-3951
lines changed

.env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ APP_DEBUG=true
55
APP_URL=http://laravel.cm.test
66
FRONTEND_APP_URL=http://localhost::4200
77

8-
FILAMENT_PATH=cpanel
9-
108
LOG_CHANNEL=stack
119
LOG_LEVEL=debug
1210

@@ -75,9 +73,12 @@ MARKDOWNX_GIPHY_API_KEY=
7573
TORCHLIGHT_TOKEN=
7674
MIX_TORCHLIGHT_TOKEN="${TORCHLIGHT_TOKEN}"
7775
UNSPLASH_ACCESS_KEY=
76+
7877
TELEGRAM_BOT_TOKEN=
7978
TELEGRAM_CHANNEL=
79+
8080
MEDIA_DISK=media
8181
FORMS_FILESYSTEM_DRIVER=${MEDIA_DISK}
82+
8283
SENTRY_LARAVEL_DSN=
8384
SENTRY_TRACES_SAMPLE_RATE=
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: fix code styling
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.2
17+
extensions: json, dom, curl, libxml, mbstring
18+
coverage: none
19+
20+
- name: Install Pint
21+
run: composer global require laravel/pint
22+
23+
- name: Run Pint
24+
run: pint
25+
26+
- name: Commit linted files
27+
uses: stefanzweifel/git-auto-commit-action@v4
28+
with:
29+
commit_message: Fix code styling

.github/workflows/npm-build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: npm-build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
npm-build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Setup PHP for Filament Notifications
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: 8.2
19+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
20+
tools: composer:v2
21+
coverage: none
22+
23+
- name: Install Composer dependencies
24+
run: composer install --prefer-dist --no-interaction
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v2
28+
with:
29+
node-version: "16.x"
30+
31+
- name: Install dependencies
32+
run: yarn install --frozen-lockfile
33+
34+
- name: Build assets
35+
run: yarn run production
36+
37+
- name: Commit changes
38+
uses: stefanzweifel/git-auto-commit-action@v4
39+
with:
40+
commit_message: Compile Assets

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ jobs:
88

99
steps:
1010
- name: Checkout code
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v3
1212

1313
- name: Setup PHP
1414
uses: shivammathur/setup-php@v2
1515
with:
16-
php-version: 8.1
16+
php-version: 8.2
1717
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
1818
tools: composer:v2
1919
coverage: none

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: helpers
2+
helpers:
3+
php artisan ide-helper:generate
4+
php artisan ide-helper:models -F helpers/ModelHelper.php -M
5+
php artisan ide-helper:meta
6+
7+
.PHONY: stan
8+
stan:
9+
composer stan

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
</p>
44

55
<p align="center">
6+
<a href="https://laravel.com">
7+
<img alt="Laravel v9.x" src="https://img.shields.io/badge/Laravel-v9.x-FF2D20">
8+
</a>
69
<a href="https://github.com/laravelcm/laravel.cm/actions">
710
<img src="https://github.com/laravelcm/laravel.cm/workflows/Tests/badge.svg" alt="Build Status" />
811
</a>
12+
<a href="https://github.com/laravelcm/laravel.cm/actions/workflows/coding-standards.yml">
13+
<img src="https://github.com/laravelcm/laravel.cm/actions/workflows/coding-standards.yml/badge.svg" alt="Coding Standards" />
14+
</a>
915
<a href="https://forge.laravel.com">
1016
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fforge.laravel.com%2Fsite-badges%2Fb0b9e269-e85c-40eb-9b8d-cfa8197a1bb2&style=plastic" alt="Laravel Forge Site Deployment Status" />
1117
</a>
1218
</p>
1319

1420
## Laravel.cm
15-
1621
Ce dépôt contient le code source du site de [Laravel.cm](https://laravel.cm). Laravel Cameroun est la plus grande communauté de
1722
développeurs PHP & Laravel résidant au Cameroun.
1823

@@ -22,13 +27,11 @@ Twitter: https://twitter.com/laravelcm <br />
2227
Groupe Slack: https://laravelcm.slack.com <br />
2328

2429
## Sponsors
25-
2630
Nous tenons à remercier ces **entreprises extraordinaires** pour leur parrainage. Si vous souhaitez devenir sponsor, veuillez visiter <a href="https://github.com/sponsors/mckenziearts">la page Laravel.cm Github de Sponsoring</a>.
2731

2832
- **[Laravel Shopper](https://laravelshopper.io)**
2933

3034
## Caractéristiques Serveur
31-
3235
The following tools are required in order to start the installation.
3336

3437
- PHP >=8.0
@@ -37,7 +40,6 @@ The following tools are required in order to start the installation.
3740
- [Valet](https://laravel.com/docs/valet#installation)
3841

3942
## Installation
40-
4143
> Notez que vous êtes libre d'ajuster l'emplacement `~/Sites/laravel.cm` à n'importe quel répertoire de votre choix sur votre machine. Ce faisant, assurez-vous d'exécuter la commande `valet link` dans le répertoire souhaité.
4244
4345
1. Clonez ce repo avec la commande `git clone git@github.com:laravelcm/laravel.cm.git ~/Sites/laravel.cm`
@@ -55,7 +57,6 @@ php artisan db:seed --class=DummyDatabaseSeeder
5557
```
5658

5759
### Media Library Pro (optionnel)
58-
5960
Pour que l'upload de fichier fonctionne en local (pour les elements qui utilise Media Library Pro comme la modification de la photo de profil) vous devez renseignez la Licence avec votre compte de Spatie. Pour ce projet une licence commune est disponible etant une `single Licence` pour ce projet uniquement. Vous devez copier coller ce code dans le fichier `auth.json` qui a ete cree a la racine et relancer la commande `composer install`
6061

6162
```json
@@ -70,7 +71,6 @@ Pour que l'upload de fichier fonctionne en local (pour les elements qui utilise
7071
```
7172

7273
### Github Authentication (optionnel)
73-
7474
Pour que l'authentification Github fonctionne localement, vous devez [enregistrer une nouvelle application OAuth sur Github](https://github.com/settings/applications/new). Utilisez `http://laravel.cm.test` pour l'URL de la page d'accueil et `http://laravel.cm.test/auth/github` pour l'URL de rappel. Lorsque vous avez créé l'application, remplissez l'ID et le secret dans votre fichier `.env` dans les variables d'environnement ci-dessous. Vous devriez maintenant pouvoir vous authentifier avec Github.
7575

7676
```shell
@@ -80,7 +80,6 @@ GITHUB_URL=http://laravel.cm.test/auth/github
8080
```
8181

8282
### Twitter Sharing (optionnel)
83-
8483
Pour permettre le partage automatique des articles publiés sur Twitter, vous devez [créer une application Twitter](https://developer.twitter.com/apps/). Une fois l'application créée, mettez à jour les variables ci-dessous dans votre fichier `.env`. La clé et le secret du consommateur ainsi que le jeton et le secret d'accès se trouvent dans la section «Clés et jetons» de l'interface utilisateur des développeurs Twitter.
8584

8685
```shell
@@ -92,13 +91,20 @@ TWITTER_ACCESS_SECRET=
9291

9392
Les articles approuvés sont partagés dans l'ordre dans lequel ils ont été soumis pour approbation. Les articles sont partagés deux fois par jour à 14h00 et 18h00 UTC. Une fois qu'un article a été partagé, il ne sera plus partagé.
9493

95-
## Commands
94+
### Notifications Telegram (optionnel)
95+
Laravel Cameroun peut notifier les administrateurs des nouveaux articles soumis via Telegram. Pour que cela fonctionne, vous devez configurer un [bot Telegram](https://core.telegram.org/bots) et obtenir un token. Ensuite, configurez le canal sur lequel vous souhaitez envoyer les messages relatifs aux nouveaux articles.
9696

97+
```shell
98+
TELEGRAM_BOT_TOKEN=
99+
TELEGRAM_CHANNEL=
100+
```
101+
102+
## Commands
97103
Command | Description
98104
--- | ---
99-
**`php artisan test --parallel`** | Exécuter les tests
105+
**`composer pest`** | Exécuter les tests
100106
`php artisan migrate:fresh --seed` | Reset la base de données
101-
`npx mix --watch` | Surveillez les changements dans les fichiers CSS et JS
107+
`yarn run watch` | Surveillez les changements dans les fichiers CSS et JS
102108

103109
## Maintainers
104110

app/Actions/Fortify/CreateNewUser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

57
use App\Models\User;

app/Actions/Fortify/PasswordValidationRules.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

57
use Illuminate\Validation\Rules;

app/Actions/Fortify/ResetUserPassword.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

57
use Illuminate\Support\Facades\Hash;
@@ -19,7 +21,7 @@ class ResetUserPassword implements ResetsUserPasswords
1921
*
2022
* @throws \Illuminate\Validation\ValidationException
2123
*/
22-
public function reset($user, array $input)
24+
public function reset($user, array $input): void
2325
{
2426
Validator::make($input, [
2527
'password' => $this->passwordRules(),

app/Actions/Fortify/UpdateUserPassword.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

7+
use App\Models\User;
58
use Illuminate\Support\Facades\Hash;
69
use Illuminate\Support\Facades\Validator;
710
use Laravel\Fortify\Contracts\UpdatesUserPasswords;
@@ -11,15 +14,11 @@ class UpdateUserPassword implements UpdatesUserPasswords
1114
use PasswordValidationRules;
1215

1316
/**
14-
* Validate and update the user's password.
15-
*
16-
* @param mixed $user
17-
* @param array $input
18-
* @return void
1917
*
20-
* @throws \Illuminate\Validation\ValidationException
18+
* @param User $user
19+
* @param string[] $input
2120
*/
22-
public function update($user, array $input)
21+
public function update(User $user, array $input): void
2322
{
2423
Validator::make($input, [
2524
'current_password' => ['required', 'string'],

app/Actions/Fortify/UpdateUserProfileInformation.php

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

5-
use Illuminate\Contracts\Auth\MustVerifyEmail;
7+
use App\Models\User;
68
use Illuminate\Support\Facades\Validator;
79
use Illuminate\Validation\Rule;
810
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
911

1012
class UpdateUserProfileInformation implements UpdatesUserProfileInformation
1113
{
1214
/**
13-
* Validate and update the given user's profile information.
14-
*
15-
* @param mixed $user
16-
* @param array $input<string, string>
17-
* @return void
18-
*
19-
* @throws \Illuminate\Validation\ValidationException
15+
* @param User $user
16+
* @param string[] $input
2017
*/
21-
public function update($user, array $input)
18+
public function update(User $user, array $input): void
2219
{
2320
Validator::make($input, [
2421
'name' => ['required', 'string', 'max:255'],
@@ -32,8 +29,7 @@ public function update($user, array $input)
3229
],
3330
])->validateWithBag('updateProfileInformation');
3431

35-
if ($input['email'] !== $user->email &&
36-
$user instanceof MustVerifyEmail) {
32+
if ($input['email'] !== $user->email) {
3733
$this->updateVerifiedUser($user, $input);
3834
} else {
3935
$user->forceFill([
@@ -44,13 +40,10 @@ public function update($user, array $input)
4440
}
4541

4642
/**
47-
* Update the given verified user's profile information.
48-
*
4943
* @param mixed $user
50-
* @param array $input
51-
* @return void
44+
* @param string[] $input
5245
*/
53-
protected function updateVerifiedUser($user, array $input)
46+
protected function updateVerifiedUser(User $user, array $input): void
5447
{
5548
$user->forceFill([
5649
'name' => $input['name'],

app/Actions/Replies/CreateReply.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Replies;
46

57
use App\Events\CommentWasAdded;

app/Actions/Replies/LikeReply.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Replies;
46

57
use App\Models\Reaction;

app/Console/Commands/AssignUserRole.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Console\Commands;
46

57
use App\Models\User;

app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Console\Commands\Cleanup;
46

57
use App\Models\User;

app/Console/Commands/CreateAdminUser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Console\Commands;
46

57
use App\Models\User;

app/Console/Commands/GenerateSitemap.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Console\Commands;
46

57
use Illuminate\Console\Command;
@@ -14,6 +16,9 @@ class GenerateSitemap extends Command
1416

1517
protected $description = 'Crawl the site to generate a sitemap.xml file';
1618

19+
/**
20+
* @var array|string[]
21+
*/
1722
private array $noIndexPaths = [
1823
'',
1924
'/forum/*',

app/Console/Commands/PostArticleToTelegram.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Console\Commands;
46

57
use App\Models\Article;

0 commit comments

Comments
 (0)