Auth: convert auth views and verification email to Nova layout
This commit is contained in:
@@ -3,14 +3,14 @@ index 45f893d..6267e3c 100644
|
||||
--- a/app/Console/Commands/AvatarsMigrate.php
|
||||
+++ b/app/Console/Commands/AvatarsMigrate.php
|
||||
@@ -2,82 +2,124 @@
|
||||
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
|
||||
+use App\Services\AvatarService;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
-use App\Services\AvatarService;
|
||||
|
||||
|
||||
class AvatarsMigrate extends Command
|
||||
{
|
||||
- /**
|
||||
@@ -39,7 +39,7 @@ index 45f893d..6267e3c 100644
|
||||
parent::__construct();
|
||||
- $this->service = $service;
|
||||
}
|
||||
|
||||
|
||||
- public function handle()
|
||||
+ public function handle(): int
|
||||
{
|
||||
@@ -47,7 +47,7 @@ index 45f893d..6267e3c 100644
|
||||
+ $limit = max(0, (int) $this->option('limit'));
|
||||
+
|
||||
$this->info('Starting avatar migration...');
|
||||
|
||||
|
||||
- // Try to read legacy data from user_profiles.avatar_legacy or users.avatar_legacy or users.icon
|
||||
- $rows = DB::table('user_profiles')->select('user_id', 'avatar_legacy')->whereNotNull('avatar_legacy')->get();
|
||||
+ $rows = DB::table('user_profiles as p')
|
||||
@@ -66,7 +66,7 @@ index 45f893d..6267e3c 100644
|
||||
+ ->orderBy('p.user_id')
|
||||
+ ->when($limit > 0, fn ($query) => $query->limit($limit))
|
||||
+ ->get();
|
||||
|
||||
|
||||
if ($rows->isEmpty()) {
|
||||
- // fallback to users table
|
||||
- $rows = DB::table('users')->select('user_id', 'icon as avatar_legacy')->whereNotNull('icon')->get();
|
||||
@@ -74,7 +74,7 @@ index 45f893d..6267e3c 100644
|
||||
+
|
||||
+ return self::SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
- $count = 0;
|
||||
+ $migrated = 0;
|
||||
+ $skipped = 0;
|
||||
@@ -98,7 +98,7 @@ index 45f893d..6267e3c 100644
|
||||
+ $this->warn("User {$userId}: legacy avatar not found ({$legacyName})");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
- // Try common legacy paths
|
||||
- $candidates = [
|
||||
- public_path('user-picture/' . $legacy),
|
||||
@@ -164,7 +164,7 @@ index 45f893d..6267e3c 100644
|
||||
+ storage_path('app/public/user-picture/' . $legacyName),
|
||||
+ base_path('oldSite/www/files/usericons/' . $legacyName),
|
||||
+ ];
|
||||
|
||||
|
||||
- if (!$found) {
|
||||
- $this->warn("Legacy file not found for user {$userId}, filename={$legacy}");
|
||||
+ foreach ($candidates as $candidate) {
|
||||
@@ -172,7 +172,7 @@ index 45f893d..6267e3c 100644
|
||||
+ return $candidate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- $this->info("Migration complete. Processed: {$count}");
|
||||
- return 0;
|
||||
+ return null;
|
||||
@@ -183,16 +183,16 @@ index b80150d..f6c1c23 100644
|
||||
--- a/app/Http/Controllers/AvatarController.php
|
||||
+++ b/app/Http/Controllers/AvatarController.php
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
|
||||
+use App\Http\Requests\AvatarUploadRequest;
|
||||
use App\Services\AvatarService;
|
||||
-use Illuminate\Http\Request;
|
||||
-use Illuminate\Support\Facades\Auth;
|
||||
-use Illuminate\Support\Facades\Validator;
|
||||
+use Illuminate\Http\JsonResponse;
|
||||
|
||||
|
||||
class AvatarController
|
||||
{
|
||||
@@ -19,22 +18,13 @@ public function __construct(AvatarService $service)
|
||||
@@ -207,7 +207,7 @@ index b80150d..f6c1c23 100644
|
||||
if (!$user) {
|
||||
return response()->json(['error' => 'Unauthorized'], 401);
|
||||
}
|
||||
|
||||
|
||||
- $rules = [
|
||||
- 'avatar' => 'required|image|max:2048|mimes:jpg,jpeg,png,webp',
|
||||
- ];
|
||||
@@ -218,20 +218,20 @@ index b80150d..f6c1c23 100644
|
||||
- }
|
||||
-
|
||||
$file = $request->file('avatar');
|
||||
|
||||
|
||||
try {
|
||||
diff --git a/app/Http/Controllers/Legacy/AvatarController.php b/app/Http/Controllers/Legacy/AvatarController.php
|
||||
index eb322a0..391c514 100644
|
||||
--- a/app/Http/Controllers/Legacy/AvatarController.php
|
||||
+++ b/app/Http/Controllers/Legacy/AvatarController.php
|
||||
@@ -4,64 +4,15 @@
|
||||
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
-use Illuminate\Support\Facades\DB;
|
||||
-use Illuminate\Support\Facades\Storage;
|
||||
+use App\Support\AvatarUrl;
|
||||
|
||||
|
||||
class AvatarController extends Controller
|
||||
{
|
||||
public function show(Request $request, $id, $name = null)
|
||||
@@ -239,7 +239,7 @@ index eb322a0..391c514 100644
|
||||
- $user_id = (int) $id;
|
||||
+ $userId = (int) $id;
|
||||
+ $target = AvatarUrl::forUser($userId, null, 128);
|
||||
|
||||
|
||||
- // default avatar in project public gfx
|
||||
- $defaultAvatar = public_path('gfx/avatar.jpg');
|
||||
-
|
||||
@@ -304,7 +304,7 @@ index cfb3b04..d1ec9cc 100644
|
||||
- ->select('t1.id', 't1.user_id', 't1.friend_id', 't2.name as uname', 'p.avatar as icon', 't1.date_added')
|
||||
+ ->select('t1.id', 't1.user_id', 't1.friend_id', 't2.name as uname', 'p.avatar_hash as icon', 't1.date_added')
|
||||
->orderByDesc('t1.date_added');
|
||||
|
||||
|
||||
$followers = $query->paginate($perPage)->withQueryString();
|
||||
diff --git a/app/Http/Controllers/Legacy/LatestCommentsController.php b/app/Http/Controllers/Legacy/LatestCommentsController.php
|
||||
index eb091e2..02db175 100644
|
||||
@@ -315,7 +315,7 @@ index eb091e2..02db175 100644
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
+use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
||||
class LatestCommentsController extends Controller
|
||||
{
|
||||
@@ -36,7 +37,7 @@ public function index(Request $request)
|
||||
@@ -338,7 +338,7 @@ index 3ff2f96..9ab8db4 100644
|
||||
- ->select('t1.id', 't1.friend_id', 't1.user_id', 't2.name as uname', 'p.avatar as icon', 't1.date_added')
|
||||
+ ->select('t1.id', 't1.friend_id', 't1.user_id', 't2.name as uname', 'p.avatar_hash as icon', 't1.date_added')
|
||||
->orderByDesc('t1.date_added');
|
||||
|
||||
|
||||
$buddies = $query->paginate($perPage)->withQueryString();
|
||||
diff --git a/app/Http/Controllers/Legacy/ProfileController.php b/app/Http/Controllers/Legacy/ProfileController.php
|
||||
index dfe911c..5d3b149 100644
|
||||
@@ -349,7 +349,7 @@ index dfe911c..5d3b149 100644
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
+use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
||||
class ProfileController extends Controller
|
||||
{
|
||||
@@ -63,7 +64,7 @@ public function show(Request $request, ?int $id = null, ?string $slug = null)
|
||||
@@ -360,13 +360,13 @@ index dfe911c..5d3b149 100644
|
||||
+ 'icon' => DB::table('user_profiles')->where('user_id', $user->id)->value('avatar_hash'),
|
||||
'about_me' => $user->bio ?? null,
|
||||
];
|
||||
|
||||
|
||||
diff --git a/app/Http/Controllers/Legacy/UserController.php b/app/Http/Controllers/Legacy/UserController.php
|
||||
index a8a3546..e7286a8 100644
|
||||
--- a/app/Http/Controllers/Legacy/UserController.php
|
||||
+++ b/app/Http/Controllers/Legacy/UserController.php
|
||||
@@ -4,11 +4,10 @@
|
||||
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
-use Illuminate\Support\Facades\Storage;
|
||||
@@ -376,10 +376,10 @@ index a8a3546..e7286a8 100644
|
||||
-use App\Models\User;
|
||||
+use App\Services\AvatarService;
|
||||
use Carbon\Carbon;
|
||||
|
||||
|
||||
class UserController extends Controller
|
||||
@@ -72,12 +71,12 @@ public function index(Request $request)
|
||||
|
||||
|
||||
// Files: avatar/photo/emoticon
|
||||
if ($request->hasFile('avatar')) {
|
||||
- $f = $request->file('avatar');
|
||||
@@ -395,7 +395,7 @@ index a8a3546..e7286a8 100644
|
||||
+ $request->session()->flash('error', 'Avatar upload failed.');
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
if ($request->hasFile('personal_picture')) {
|
||||
@@ -141,7 +140,7 @@ public function index(Request $request)
|
||||
if (isset($profile->birthdate)) $user->birth = $profile->birthdate;
|
||||
@@ -441,7 +441,7 @@ index fc76f6c..d679929 100644
|
||||
--- a/app/Models/User.php
|
||||
+++ b/app/Models/User.php
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
+use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
@@ -451,7 +451,7 @@ index fc76f6c..d679929 100644
|
||||
@@ -55,6 +56,11 @@ public function artworks(): HasMany
|
||||
return $this->hasMany(Artwork::class);
|
||||
}
|
||||
|
||||
|
||||
+ public function profile(): HasOne
|
||||
+ {
|
||||
+ return $this->hasOne(UserProfile::class, 'user_id');
|
||||
@@ -465,12 +465,12 @@ index 46c06ce..7bb3de6 100644
|
||||
--- a/app/Models/UserProfile.php
|
||||
+++ b/app/Models/UserProfile.php
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
-use Illuminate\Support\Facades\Storage;
|
||||
+use App\Support\AvatarUrl;
|
||||
|
||||
|
||||
class UserProfile extends Model
|
||||
{
|
||||
@@ -18,7 +18,7 @@ class UserProfile extends Model
|
||||
@@ -485,7 +485,7 @@ index 46c06ce..7bb3de6 100644
|
||||
@@ -43,27 +43,12 @@ public function user(): BelongsTo
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
|
||||
- /**
|
||||
- * Return a public URL for the avatar when stored on the `public` disk under `avatars/`.
|
||||
- */
|
||||
@@ -495,7 +495,7 @@ index 46c06ce..7bb3de6 100644
|
||||
+ if (empty($this->user_id)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
- // If the stored value already looks like a full URL, return it.
|
||||
- if (preg_match('#^https?://#i', $this->avatar)) {
|
||||
- return $this->avatar;
|
||||
@@ -524,9 +524,9 @@ index 1155fb1..8a4f9ed 100644
|
||||
+ $avatarHash = null;
|
||||
$displayName = null;
|
||||
$userId = null;
|
||||
|
||||
|
||||
@@ -72,15 +72,15 @@ public function boot(): void
|
||||
|
||||
|
||||
try {
|
||||
$profile = DB::table('user_profiles')->where('user_id', $userId)->first();
|
||||
- $avatar = $profile->avatar ?? null;
|
||||
@@ -535,23 +535,23 @@ index 1155fb1..8a4f9ed 100644
|
||||
- $avatar = null;
|
||||
+ $avatarHash = null;
|
||||
}
|
||||
|
||||
|
||||
$displayName = Auth::user()->name ?: (Auth::user()->username ?? '');
|
||||
}
|
||||
|
||||
|
||||
- $view->with(compact('userId','uploadCount', 'favCount', 'msgCount', 'noticeCount', 'avatar', 'displayName'));
|
||||
+ $view->with(compact('userId','uploadCount', 'favCount', 'msgCount', 'noticeCount', 'avatarHash', 'displayName'));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
diff --git a/app/Services/AvatarService.php b/app/Services/AvatarService.php
|
||||
index 1430ab9..2fb38dd 100644
|
||||
--- a/app/Services/AvatarService.php
|
||||
+++ b/app/Services/AvatarService.php
|
||||
@@ -2,15 +2,22 @@
|
||||
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
|
||||
-use Illuminate\Support\Facades\Storage;
|
||||
-use Illuminate\Support\Facades\DB;
|
||||
-use Intervention\Image\ImageManagerStatic as Image;
|
||||
@@ -565,7 +565,7 @@ index 1430ab9..2fb38dd 100644
|
||||
+use Intervention\Image\Encoders\WebpEncoder;
|
||||
+use Intervention\Image\ImageManager;
|
||||
+use RuntimeException;
|
||||
|
||||
|
||||
class AvatarService
|
||||
{
|
||||
+ private const ALLOWED_EXTENSIONS = ['jpg', 'jpeg', 'png', 'webp'];
|
||||
@@ -576,9 +576,9 @@ index 1430ab9..2fb38dd 100644
|
||||
'xs' => 32,
|
||||
'sm' => 64,
|
||||
@@ -21,149 +28,160 @@ class AvatarService
|
||||
|
||||
|
||||
protected $quality = 85;
|
||||
|
||||
|
||||
+ private ?ImageManager $manager = null;
|
||||
+
|
||||
public function __construct()
|
||||
@@ -601,7 +601,7 @@ index 1430ab9..2fb38dd 100644
|
||||
+ $this->sizes = array_combine(array_keys($this->sizes), $configuredSizes);
|
||||
}
|
||||
- }
|
||||
|
||||
|
||||
- /**
|
||||
- * Process an uploaded file for a user and store webp sizes.
|
||||
- * Returns the computed sha1 hash.
|
||||
@@ -616,7 +616,7 @@ index 1430ab9..2fb38dd 100644
|
||||
- throw new RuntimeException('Intervention Image is not available. If you just installed the package, restart your PHP process (php artisan serve or PHP-FPM) and run `composer dump-autoload -o`.');
|
||||
- }
|
||||
+ $this->quality = (int) config('avatars.quality', 85);
|
||||
|
||||
|
||||
- // Load image and re-encode to webp after validating
|
||||
try {
|
||||
- $img = Image::make($file->getRealPath());
|
||||
@@ -648,7 +648,7 @@ index 1430ab9..2fb38dd 100644
|
||||
+ $this->manager = null;
|
||||
}
|
||||
+ }
|
||||
|
||||
|
||||
- $hash = sha1($originalData);
|
||||
- $mime = 'image/webp';
|
||||
+ public function storeFromUploadedFile(int $userId, UploadedFile $file): string
|
||||
@@ -656,7 +656,7 @@ index 1430ab9..2fb38dd 100644
|
||||
+ $this->assertImageManagerAvailable();
|
||||
+ $this->assertStorageIsAllowed();
|
||||
+ $this->assertSecureImageUpload($file);
|
||||
|
||||
|
||||
- // Persist metadata to user_profiles if exists, otherwise users table fallbacks
|
||||
- if (SchemaHasTable('user_profiles')) {
|
||||
- DB::table('user_profiles')->where('user_id', $userId)->update([
|
||||
@@ -674,11 +674,11 @@ index 1430ab9..2fb38dd 100644
|
||||
+ if ($binary === false || $binary === '') {
|
||||
+ throw new RuntimeException('Uploaded avatar file is empty or unreadable.');
|
||||
}
|
||||
|
||||
|
||||
- return $hash;
|
||||
+ return $this->storeFromBinary($userId, $binary);
|
||||
}
|
||||
|
||||
|
||||
- /**
|
||||
- * Process a legacy file path for a user (path-to-file).
|
||||
- * Returns sha1 or null when missing.
|
||||
@@ -695,7 +695,7 @@ index 1430ab9..2fb38dd 100644
|
||||
if (!file_exists($path) || !is_readable($path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
- try {
|
||||
- $img = Image::make($path);
|
||||
- } catch (\Exception $e) {
|
||||
@@ -703,7 +703,7 @@ index 1430ab9..2fb38dd 100644
|
||||
+ if ($binary === false || $binary === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
- $max = max($img->width(), $img->height());
|
||||
- $img->fit($max, $max);
|
||||
+ return $this->storeFromBinary($userId, $binary);
|
||||
@@ -712,12 +712,12 @@ index 1430ab9..2fb38dd 100644
|
||||
+ private function storeFromBinary(int $userId, string $binary): string
|
||||
+ {
|
||||
+ $image = $this->readImageFromBinary($binary);
|
||||
|
||||
|
||||
+ $diskName = (string) config('avatars.disk', 'public');
|
||||
+ $disk = Storage::disk($diskName);
|
||||
$basePath = "avatars/{$userId}";
|
||||
- Storage::disk('public')->makeDirectory($basePath);
|
||||
|
||||
|
||||
- $originalData = (string) $img->encode('webp', $this->quality);
|
||||
- Storage::disk('public')->put($basePath . '/original.webp', $originalData);
|
||||
+ $hashSeed = '';
|
||||
@@ -729,7 +729,7 @@ index 1430ab9..2fb38dd 100644
|
||||
+ 'CacheControl' => 'public, max-age=31536000, immutable',
|
||||
+ 'ContentType' => 'image/webp',
|
||||
+ ]);
|
||||
|
||||
|
||||
- foreach ($this->sizes as $name => $size) {
|
||||
- $resized = $img->resize($size, $size, function ($constraint) {
|
||||
- $constraint->upsize();
|
||||
@@ -739,13 +739,13 @@ index 1430ab9..2fb38dd 100644
|
||||
+ $hashSeed = $encoded;
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
- $hash = sha1($originalData);
|
||||
- $mime = 'image/webp';
|
||||
+ if ($hashSeed === '') {
|
||||
+ throw new RuntimeException('Avatar processing failed to generate a hash seed.');
|
||||
+ }
|
||||
|
||||
|
||||
- if (SchemaHasTable('user_profiles')) {
|
||||
- DB::table('user_profiles')->where('user_id', $userId)->update([
|
||||
- 'avatar_hash' => $hash,
|
||||
@@ -788,12 +788,12 @@ index 1430ab9..2fb38dd 100644
|
||||
+ if ($this->manager !== null) {
|
||||
+ return;
|
||||
}
|
||||
|
||||
|
||||
- return $hash;
|
||||
+ throw new RuntimeException('Avatar image processing is not available on this environment.');
|
||||
}
|
||||
-}
|
||||
|
||||
|
||||
-/**
|
||||
- * Helper: check for table existence without importing Schema facade repeatedly
|
||||
- */
|
||||
@@ -849,10 +849,10 @@ index b1b1cd0..9c70607 100644
|
||||
--- a/config/cdn.php
|
||||
+++ b/config/cdn.php
|
||||
@@ -4,4 +4,5 @@
|
||||
|
||||
|
||||
return [
|
||||
'files_url' => env('FILES_CDN_URL', 'https://files.skinbase.org'),
|
||||
+ 'avatar_url' => env('AVATAR_CDN_URL', 'https://file.skinbase.org'),
|
||||
+ 'avatar_url' => env('AVATAR_CDN_URL', 'https://files.skinbase.org'),
|
||||
];
|
||||
diff --git a/resources/views/components/avatar.blade.php b/resources/views/components/avatar.blade.php
|
||||
index 0b90950..bae1a02 100644
|
||||
@@ -888,7 +888,7 @@ index 5852dd8..71bf8d5 100644
|
||||
+++ b/resources/views/legacy/art.blade.php
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div style="clear:both;margin-top:10px;">
|
||||
- <img src="/avatar/{{ $artwork->user_id ?? 0 }}/{{ urlencode($artwork->icon ?? '') }}" class="pull-left" style="padding-right:10px;max-height:50px;" alt="Avatar">
|
||||
+ <img src="{{ \App\Support\AvatarUrl::forUser((int) ($artwork->user_id ?? 0), null, 50) }}" class="pull-left" style="padding-right:10px;max-height:50px;" alt="Avatar">
|
||||
@@ -918,7 +918,7 @@ index 1d91897..6b15b25 100644
|
||||
--- a/resources/views/legacy/buddies.blade.php
|
||||
+++ b/resources/views/legacy/buddies.blade.php
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
|
||||
<div>
|
||||
<a href="/profile/{{ $followerId }}/{{ Str::slug($uname) }}">
|
||||
- <img src="/avatar/{{ $followerId }}/{{ rawurlencode($icon) }}" alt="{{ $uname }}">
|
||||
@@ -990,7 +990,7 @@ index ed99954..2e33899 100644
|
||||
+ <img src="{{ \App\Support\AvatarUrl::forUser((int) $comment->commenter_id, null, 50) }}" width="50" height="50" class="comment_avatar" alt="{{ $comment->uname }}">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
diff --git a/resources/views/legacy/monthly-commentators.blade.php b/resources/views/legacy/monthly-commentators.blade.php
|
||||
index 28b7921..7066d11 100644
|
||||
--- a/resources/views/legacy/monthly-commentators.blade.php
|
||||
@@ -1009,14 +1009,14 @@ index 13fd2c6..c91f446 100644
|
||||
--- a/resources/views/legacy/mybuddies.blade.php
|
||||
+++ b/resources/views/legacy/mybuddies.blade.php
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
|
||||
<div>
|
||||
<a href="/profile/{{ $friendId }}/{{ Str::slug($uname) }}">
|
||||
- <img src="/avatar/{{ $friendId }}/{{ rawurlencode($icon) }}" alt="{{ $uname }}">
|
||||
+ <img src="{{ \App\Support\AvatarUrl::forUser((int) $friendId, null, 50) }}" alt="{{ $uname }}">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
diff --git a/resources/views/legacy/news.blade.php b/resources/views/legacy/news.blade.php
|
||||
index 7c87583..0d87945 100644
|
||||
--- a/resources/views/legacy/news.blade.php
|
||||
@@ -1055,7 +1055,7 @@ index 75f08fd..855bd95 100644
|
||||
+ <img src="{{ \App\Support\AvatarUrl::forUser((int) ($author->id ?? $author->user_id), null, 50) }}" width="50" height="50" class="comment_avatar" alt="{{ $author->name ?? $author->uname ?? '' }}">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
diff --git a/resources/views/legacy/toolbar.blade.php b/resources/views/legacy/toolbar.blade.php
|
||||
index 5dcbf97..0cefc74 100644
|
||||
--- a/resources/views/legacy/toolbar.blade.php
|
||||
@@ -1073,7 +1073,7 @@ index 5dcbf97..0cefc74 100644
|
||||
$displayName = auth()->user()->name ?: (auth()->user()->username ?? '');
|
||||
@endphp
|
||||
@@ -141,9 +141,7 @@
|
||||
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle c-white" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
|
||||
- @if($avatar)
|
||||
@@ -1120,18 +1120,18 @@ index aafbf67..3928cbf 100644
|
||||
+++ b/tests/Feature/AvatarUploadTest.php
|
||||
@@ -1,15 +1,64 @@
|
||||
<?php
|
||||
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
+use Illuminate\Http\UploadedFile;
|
||||
+use Illuminate\Support\Facades\DB;
|
||||
+use Illuminate\Support\Facades\Storage;
|
||||
+use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
|
||||
class AvatarUploadTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
|
||||
+ protected function setUp(): void
|
||||
+ {
|
||||
+ parent::setUp();
|
||||
|
||||
Reference in New Issue
Block a user