Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .claude/settings.local.json

This file was deleted.

2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ README.md
.idea
.vscode
.junie
.claude

# Git
.gitignore
.gitattributes
.github
.gitkeep

# Others
art
13 changes: 10 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ APP_SERVICE=laravelcm
FILAMENT_PATH=cp

LOG_CHANNEL=stack
LOG_STACK=single,nightwatch
LOG_LEVEL=debug

DB_CONNECTION=mysql
Expand Down Expand Up @@ -71,9 +72,6 @@ TELEGRAM_CHANNEL=
MEDIA_DISK=media
FILAMENT_FILESYSTEM_DISK=${MEDIA_DISK}

SENTRY_LARAVEL_DSN=
SENTRY_TRACES_SAMPLE_RATE=1.0

NOTCHPAY_PUBLIC_KEY=

TWITTER_CONSUMER_KEY=your-consumer-key
Expand All @@ -85,3 +83,12 @@ GOOGLE_RECAPTCHA_SITE_KEY=your-recaptcha-site-key
GOOGLE_RECAPTCHA_SECRET_KEY=your-secret-key

GITHUB_FINE_GRAINED_TOKEN=

SCOUT_DRIVER=typesense
TYPESENSE_HOST=typesense
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http
TYPESENSE_API_KEY=xyz

NIGHTWATCH_TOKEN=
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pnpm-lock.yml
/vendor
composer.phar
/.junie
/.claude
/.idea
/.vscode
.phpunit.cache
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ COPY --from=frontend --chown=www-data:www-data /app/public/build ./public/build
# Application source
COPY --chown=www-data:www-data . /var/www/html

# Install Octane with FrankenPHP
# Start Octane with FrankenPHP
RUN php artisan octane:start --server=frankenphp -n
56 changes: 28 additions & 28 deletions app-modules/gamify/composer.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"name": "laravelcm/gamify",
"description": "Module laravelcm/gamify for Laravel.cm",
"type": "library",
"version": "1.1.0",
"license": "proprietary",
"require": {
"filament/filament": "^3.2"
},
"require-dev": {
"pestphp/pest": "^2.32",
"pestphp/pest-plugin-laravel": "^2.1"
},
"autoload": {
"psr-4": {
"Laravelcm\\Gamify\\": "src/",
"Laravelcm\\Gamify\\Database\\Factories\\": "database/factories/",
"Laravelcm\\Gamify\\Database\\Seeders\\": "database/seeders/"
},
"files": [
"src/helpers.php"
]
"name": "laravelcm/gamify",
"description": "Module laravelcm/gamify for Laravel.cm",
"type": "library",
"version": "1.1.0",
"license": "proprietary",
"require": {
"filament/filament": "^3.2"
},
"require-dev": {
"pestphp/pest": "^2.32",
"pestphp/pest-plugin-laravel": "^2.1"
},
"autoload": {
"psr-4": {
"Laravelcm\\Gamify\\": "src/",
"Laravelcm\\Gamify\\Database\\Factories\\": "database/factories/",
"Laravelcm\\Gamify\\Database\\Seeders\\": "database/seeders/"
},
"files": [
"src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Laravelcm\\Gamify\\Tests\\": "tests/"
}
},
"minimum-stability": "stable",
"extra": {
"laravel": {
"providers": [
"Laravelcm\\Gamify\\Providers\\GamifyServiceProvider"
]
}
"minimum-stability": "stable",
"extra": {
"laravel": {
"providers": [
"Laravelcm\\Gamify\\Providers\\GamifyServiceProvider"
]
}
}
}
2 changes: 1 addition & 1 deletion app-modules/gamify/tests/Feature/PointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct($subject = null)
$this->subject = $subject;
}

public function payee(): ?User
public function payee(): User
{
return new User;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Resources/ArticleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static function table(Table $table): Table
}),
Tables\Actions\Action::make('show')
->icon('untitledui-eye')
->url(fn (Article $record) => route('articles.show', $record))
->url(fn (Article $record): string => route('articles.show', $record))
->openUrlInNewTab()
->label('Afficher'),
Tables\Actions\DeleteAction::make(),
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Resources/DiscussionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function table(Table $table): Table
->icon('untitledui-eye')
->iconButton()
->color('gray')
->url(fn (Discussion $record) => route('discussions.show', $record))
->url(fn (Discussion $record): string => route('discussions.show', $record))
->openUrlInNewTab(),
Tables\Actions\DeleteAction::make()
->iconButton(),
Expand Down
6 changes: 3 additions & 3 deletions app/Models/Enterprise.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ public function registerMediaCollections(): void
->singleFile()
->acceptsMimeTypes([
'image/jpg',
'image/jpeg',
'image/png',
'image/svg',
'image/gif',
'image/webp',
]);

$this->addMediaCollection('cover')
->singleFile()
->acceptsMimeTypes([
'image/jpg',
'image/jpeg',
'image/png',
'image/webp',
]);
}

Expand Down Expand Up @@ -95,7 +95,7 @@ protected function public(Builder $query): void
* @param string[] $filters
*/
#[Scope]
public function filters(Builder $query, Request $request, array $filters = []): Builder
protected function filters(Builder $query, Request $request, array $filters = []): Builder
{
return new EnterpriseFilters($request)->add($filters)->filter($query);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Reply.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function isSolution(Builder $query): void
$query->has('solutionTo');
}

public function delete(): ?bool
public function delete(): bool
{
$this->deleteReplies();

Expand Down
18 changes: 18 additions & 0 deletions app/Models/SocialAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,26 @@
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
* @property-read int $id
* @property-read string $provider
* @property-read string $provider_id
* @property-read int $user_id
* @property-read string|null $token
* @property-read string|null $avatar
* @property-read User $user
*/
final class SocialAccount extends Model
{
protected $guarded = [];

/**
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}
4 changes: 2 additions & 2 deletions app/Models/Thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function isSolutionReply(Reply $reply): bool

public function isSolved(): bool
{
return $this->solution_reply_id !== null;
return filled($this->solution_reply_id);
}

public function wasResolvedBy(User $user): bool
Expand Down Expand Up @@ -152,7 +152,7 @@ public function unmarkSolution(): void
$this->save();
}

public function delete(): ?bool
public function delete(): bool
{
$this->channels()->detach();
$this->deleteReplies();
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function getFilamentName(): string
return $this->name;
}

public function getFilamentAvatarUrl(): ?string
public function getFilamentAvatarUrl(): string
{
return $this->profile_photo_url;
}
Expand Down
3 changes: 2 additions & 1 deletion app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Filament\Panel;
use Filament\PanelProvider;
use Filament\SpatieLaravelTranslatablePlugin;
use Illuminate\Contracts\View\View;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
Expand All @@ -36,7 +37,7 @@ public function panel(Panel $panel): Panel
->sidebarWidth('18.75rem')
->sidebarCollapsibleOnDesktop()
->viteTheme('resources/css/filament/admin/theme.css')
->brandLogo(fn () => view('filament.brand'))
->brandLogo(fn (): View => view('filament.brand'))
->favicon(asset('images/favicons/favicon-32x32.png'))
->spa()
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
Expand Down
25 changes: 14 additions & 11 deletions app/Traits/HasProfilePhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
namespace App\Traits;

use App\Models\SocialAccount;
use Illuminate\Database\Eloquent\Casts\Attribute;

trait HasProfilePhoto
{
public function getProfilePhotoUrlAttribute(): ?string
protected function profilePhotoUrl(): Attribute
{
if ($this->avatar_type === 'storage') {
return $this->getFirstMediaUrl('avatar');
}
return Attribute::get(function (): ?string {
if ($this->avatar_type === 'storage') {
return $this->getFirstMediaUrl('avatar');
}

if (! in_array($this->avatar_type, ['avatar', 'storage'])) {
/** @var SocialAccount $social_avatar */
$social_avatar = $this->providers->firstWhere('provider', $this->avatar_type);
if (! in_array($this->avatar_type, ['avatar', 'storage'])) {
/** @var SocialAccount $social_avatar */
$social_avatar = $this->providers->firstWhere('provider', $this->avatar_type);

// @phpstan-ignore-next-line
return $social_avatar ? $social_avatar->avatar : $this->defaultProfilePhotoUrl();
}
// @phpstan-ignore-next-line
return $social_avatar ? $social_avatar->avatar : $this->defaultProfilePhotoUrl();
}

return $this->defaultProfilePhotoUrl();
return $this->defaultProfilePhotoUrl();
});
}

protected function defaultProfilePhotoUrl(): ?string
Expand Down
2 changes: 1 addition & 1 deletion app/Traits/HasTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function removeTags(): void
}

#[Scope]
public function forTag(Builder $query, string $tag): void
protected function forTag(Builder $query, string $tag): void
{
$query->whereHas('tags', function ($query) use ($tag): void {
$query->where('tags.slug', $tag);
Expand Down
12 changes: 4 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
"laravel-notification-channels/telegram": "^6.0",
"laravel-notification-channels/twitter": "^8.1",
"laravel/framework": "^12.0",
"laravel/nightwatch": "^1.13",
"laravel/octane": "^2.12",
"laravel/socialite": "^5.6.3",
"laravel/tinker": "^2.8.1",
"laravelcm/gamify": "*",
"laravelcm/gamify": "^1.1",
"laravelcm/laravel-subscriptions": "^1.3",
"laravelcm/livewire-slide-overs": "^1.0",
"livewire/volt": "^1.6",
"mckenziearts/blade-untitledui-icons": "^1.4",
"notchpay/notchpay-php": "^1.6",
"ramsey/uuid": "^4.7.4",
"sentry/sentry-laravel": "^4.10",
"spatie/laravel-data": "^4.10",
"spatie/laravel-feed": "^4.2.1",
"spatie/laravel-google-fonts": "^1.2.3",
Expand Down Expand Up @@ -101,7 +101,7 @@
],
"dev:install": [
"./vendor/bin/sail up -d",
"./vendor/bin/sail artisan migrate",
"./vendor/bin/sail artisan migrate --seed",
"./vendor/bin/sail npm install --no-update-notifier",
"./vendor/bin/sail stop"
],
Expand All @@ -118,11 +118,7 @@
"types": "phpstan analyse --memory-limit=-1",
"rector": "./vendor/bin/rector",
"rector:preview": "./vendor/bin/rector --dry-run",
"test": "./vendor/bin/sail pest",
"setup": [
"@php artisan db:seed",
"@php artisan lcm:admin"
]
"test": "./vendor/bin/sail pest"
},
"config": {
"optimize-autoloader": true,
Expand Down
Loading
Loading