More Updates

- Updates dependancies
- Added time to mod component
- Implement naturalSort function into homepage queries

Short todo:
- Migrate top navigation from old-build
- Mod detail page
This commit is contained in:
Refringe 2024-05-28 17:19:36 -04:00
parent 787f796ad7
commit 4cb739f50c
Signed by: Refringe
GPG Key ID: 7715B85B4A6306ED
20 changed files with 242 additions and 120 deletions

View File

@ -57,6 +57,11 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://127.0.0.1:7700
MEILISEARCH_KEY=FORGE
MEILISEARCH_NO_ANALYTICS=true
MAIL_MAILER=log MAIL_MAILER=log
MAIL_HOST=127.0.0.1 MAIL_HOST=127.0.0.1
MAIL_PORT=2525 MAIL_PORT=2525

View File

@ -25,11 +25,21 @@ class ModController extends Controller
return new ModResource(Mod::create($request->validated())); return new ModResource(Mod::create($request->validated()));
} }
public function show(Mod $mod) public function show(int $modId, string $slug)
{ {
$mod = Mod::select(['id', 'user_id', 'name', 'slug', 'teaser', 'thumbnail', 'featured'])
->withLatestSptVersion()
->withTotalDownloads()
->with('user:id,name')
->find($modId);
if (!$mod || $mod->slug !== $slug) {
abort(404);
}
$this->authorize('view', $mod); $this->authorize('view', $mod);
return new ModResource($mod); return view('mod.show', compact('mod'));
} }
public function update(ModRequest $request, Mod $mod) public function update(ModRequest $request, Mod $mod)

View File

@ -5,24 +5,21 @@ namespace App\Http\Resources;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Http\Resources\Json\JsonResource;
/** @mixin \App\Models\Mod */
class ModResource extends JsonResource class ModResource extends JsonResource
{ {
public function toArray(Request $request): array public function toArray(Request $request): array
{ {
return [ return [
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'id' => $this->id, 'id' => $this->id,
'name' => $this->name, 'name' => $this->name,
'slug' => $this->slug, 'slug' => $this->slug,
'description' => $this->description, 'description' => $this->description,
'source_code_link' => $this->source_code_link, 'source_code_link' => $this->source_code_link,
'user_id' => $this->user_id, 'user_id' => $this->user_id,
'license_id' => $this->license_id, 'license_id' => $this->license_id,
'license' => new LicenseResource($this->whenLoaded('license')), 'license' => new LicenseResource($this->whenLoaded('license')),
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]; ];
} }
} }

View File

@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str; use Illuminate\Support\Str;
class Mod extends Model class Mod extends Model
@ -66,10 +67,10 @@ class Mod extends Model
->orderByDesc( ->orderByDesc(
SptVersion::select('version') SptVersion::select('version')
->whereColumn('mod_versions.spt_version_id', 'spt_versions.id') ->whereColumn('mod_versions.spt_version_id', 'spt_versions.id')
->orderByDesc('version') ->orderByDesc(DB::raw('naturalSort(version)'))
->take(1), ->take(1),
) )
->orderByDesc('version') ->orderByDesc(DB::raw('naturalSort(version)'))
->take(1), ->take(1),
]) ])
->with(['latestSptVersion', 'latestSptVersion.sptVersion']); ->with(['latestSptVersion', 'latestSptVersion.sptVersion']);

View File

@ -0,0 +1,67 @@
<?php
namespace App\Policies;
use App\Models\Mod;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class ModPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
//
}
/**
* Determine whether the user can view the model.
*/
public function view(?User $user, Mod $mod): bool
{
// Everyone can view mods.
return true;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
//
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Mod $mod): bool
{
//
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Mod $mod): bool
{
//
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Mod $mod): bool
{
//
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Mod $mod): bool
{
//
}
}

View File

@ -36,7 +36,7 @@ class ModListSection extends Component
private function fetchLatestMods(): Collection private function fetchLatestMods(): Collection
{ {
return Mod::select(['id', 'user_id', 'name', 'slug', 'teaser', 'thumbnail', 'featured']) return Mod::select(['id', 'user_id', 'name', 'slug', 'teaser', 'thumbnail', 'featured', 'created_at'])
->withLatestSptVersion() ->withLatestSptVersion()
->withTotalDownloads() ->withTotalDownloads()
->with('user:id,name') ->with('user:id,name')

View File

@ -0,0 +1,20 @@
<?php
namespace App\View\Components;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class ModListStats extends Component
{
public function __construct(
public $mod,
public $modVersion
) {
}
public function render(): View
{
return view('components.mod-list-stats');
}
}

156
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "97244cec2c528738d97cf3b96c127b04", "content-hash": "ca3ac0463e2bccac87eddb5c41b29a5b",
"packages": [ "packages": [
{ {
"name": "bacon/bacon-qr-code", "name": "bacon/bacon-qr-code",
@ -1565,16 +1565,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v11.8.0", "version": "v11.9.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "ceb892a25817c888ef3df4d1a2af9cac53978300" "reference": "60167ce91c59ed5eea2ad4f2a7b6d686fb103ba7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/ceb892a25817c888ef3df4d1a2af9cac53978300", "url": "https://api.github.com/repos/laravel/framework/zipball/60167ce91c59ed5eea2ad4f2a7b6d686fb103ba7",
"reference": "ceb892a25817c888ef3df4d1a2af9cac53978300", "reference": "60167ce91c59ed5eea2ad4f2a7b6d686fb103ba7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1766,7 +1766,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2024-05-21T17:57:45+00:00" "time": "2024-05-28T18:16:41+00:00"
}, },
{ {
"name": "laravel/jetstream", "name": "laravel/jetstream",
@ -1837,17 +1837,17 @@
}, },
{ {
"name": "laravel/nova", "name": "laravel/nova",
"version": "4.33.3", "version": "4.34.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "git@github.com:laravel/nova.git", "url": "git@github.com:laravel/nova.git",
"reference": "0f308ea895bb202cced2493722b40ec172e0c108" "reference": "4e85f31d46b70291f24ccf2162096db87e82e8b2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://nova.laravel.com/dist/laravel/nova/laravel-nova-0f308ea895bb202cced2493722b40ec172e0c108-zip-e38c97.zip", "url": "https://nova.laravel.com/dist/laravel/nova/laravel-nova-4e85f31d46b70291f24ccf2162096db87e82e8b2-zip-023aa4.zip",
"reference": "0f308ea895bb202cced2493722b40ec172e0c108", "reference": "4e85f31d46b70291f24ccf2162096db87e82e8b2",
"shasum": "2ec5564e35e52cac368274b063880d9068a1e345" "shasum": "ad0981b85da448ecf8ffe38ef0d49c342734708e"
}, },
"require": { "require": {
"brick/money": "^0.5|^0.6|^0.7|^0.8|^0.9", "brick/money": "^0.5|^0.6|^0.7|^0.8|^0.9",
@ -1957,22 +1957,22 @@
"laravel" "laravel"
], ],
"support": { "support": {
"source": "https://github.com/laravel/nova/tree/v4.33.3" "source": "https://github.com/laravel/nova/tree/v4.34.2"
}, },
"time": "2024-04-18T00:44:42+00:00" "time": "2024-05-23T15:59:51+00:00"
}, },
{ {
"name": "laravel/prompts", "name": "laravel/prompts",
"version": "v0.1.22", "version": "v0.1.23",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/prompts.git", "url": "https://github.com/laravel/prompts.git",
"reference": "37f94de71758dbfbccc9d299b0e5eb76e02a40f5" "reference": "9bc4df7c699b0452c6b815e64a2d84b6d7f99400"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/prompts/zipball/37f94de71758dbfbccc9d299b0e5eb76e02a40f5", "url": "https://api.github.com/repos/laravel/prompts/zipball/9bc4df7c699b0452c6b815e64a2d84b6d7f99400",
"reference": "37f94de71758dbfbccc9d299b0e5eb76e02a40f5", "reference": "9bc4df7c699b0452c6b815e64a2d84b6d7f99400",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2015,22 +2015,22 @@
"description": "Add beautiful and user-friendly forms to your command-line applications.", "description": "Add beautiful and user-friendly forms to your command-line applications.",
"support": { "support": {
"issues": "https://github.com/laravel/prompts/issues", "issues": "https://github.com/laravel/prompts/issues",
"source": "https://github.com/laravel/prompts/tree/v0.1.22" "source": "https://github.com/laravel/prompts/tree/v0.1.23"
}, },
"time": "2024-05-10T19:22:18+00:00" "time": "2024-05-27T13:53:20+00:00"
}, },
{ {
"name": "laravel/pulse", "name": "laravel/pulse",
"version": "v1.2.0", "version": "v1.2.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/pulse.git", "url": "https://github.com/laravel/pulse.git",
"reference": "37fcc8e77dc437c01ee1a73ba58fd70615c84855" "reference": "6add38347003ee602a4c5c2a7cb920c092ac3a25"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/pulse/zipball/37fcc8e77dc437c01ee1a73ba58fd70615c84855", "url": "https://api.github.com/repos/laravel/pulse/zipball/6add38347003ee602a4c5c2a7cb920c092ac3a25",
"reference": "37fcc8e77dc437c01ee1a73ba58fd70615c84855", "reference": "6add38347003ee602a4c5c2a7cb920c092ac3a25",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2104,7 +2104,7 @@
"issues": "https://github.com/laravel/pulse/issues", "issues": "https://github.com/laravel/pulse/issues",
"source": "https://github.com/laravel/pulse" "source": "https://github.com/laravel/pulse"
}, },
"time": "2024-05-17T16:22:20+00:00" "time": "2024-05-26T23:09:52+00:00"
}, },
{ {
"name": "laravel/sanctum", "name": "laravel/sanctum",
@ -2549,16 +2549,16 @@
}, },
{ {
"name": "league/flysystem", "name": "league/flysystem",
"version": "3.27.0", "version": "3.28.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/flysystem.git", "url": "https://github.com/thephpleague/flysystem.git",
"reference": "4729745b1ab737908c7d055148c9a6b3e959832f" "reference": "e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4729745b1ab737908c7d055148c9a6b3e959832f", "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c",
"reference": "4729745b1ab737908c7d055148c9a6b3e959832f", "reference": "e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2582,10 +2582,13 @@
"composer/semver": "^3.0", "composer/semver": "^3.0",
"ext-fileinfo": "*", "ext-fileinfo": "*",
"ext-ftp": "*", "ext-ftp": "*",
"ext-mongodb": "^1.3",
"ext-zip": "*", "ext-zip": "*",
"friendsofphp/php-cs-fixer": "^3.5", "friendsofphp/php-cs-fixer": "^3.5",
"google/cloud-storage": "^1.23", "google/cloud-storage": "^1.23",
"guzzlehttp/psr7": "^2.6",
"microsoft/azure-storage-blob": "^1.1", "microsoft/azure-storage-blob": "^1.1",
"mongodb/mongodb": "^1.2",
"phpseclib/phpseclib": "^3.0.36", "phpseclib/phpseclib": "^3.0.36",
"phpstan/phpstan": "^1.10", "phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5.11|^10.0", "phpunit/phpunit": "^9.5.11|^10.0",
@ -2623,32 +2626,22 @@
], ],
"support": { "support": {
"issues": "https://github.com/thephpleague/flysystem/issues", "issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.27.0" "source": "https://github.com/thephpleague/flysystem/tree/3.28.0"
}, },
"funding": [ "time": "2024-05-22T10:09:12+00:00"
{
"url": "https://ecologi.com/frankdejonge",
"type": "custom"
},
{
"url": "https://github.com/frankdejonge",
"type": "github"
}
],
"time": "2024-04-07T19:17:50+00:00"
}, },
{ {
"name": "league/flysystem-local", "name": "league/flysystem-local",
"version": "3.25.1", "version": "3.28.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/flysystem-local.git", "url": "https://github.com/thephpleague/flysystem-local.git",
"reference": "61a6a90d6e999e4ddd9ce5adb356de0939060b92" "reference": "13f22ea8be526ea58c2ddff9e158ef7c296e4f40"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/61a6a90d6e999e4ddd9ce5adb356de0939060b92", "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/13f22ea8be526ea58c2ddff9e158ef7c296e4f40",
"reference": "61a6a90d6e999e4ddd9ce5adb356de0939060b92", "reference": "13f22ea8be526ea58c2ddff9e158ef7c296e4f40",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2682,19 +2675,9 @@
"local" "local"
], ],
"support": { "support": {
"source": "https://github.com/thephpleague/flysystem-local/tree/3.25.1" "source": "https://github.com/thephpleague/flysystem-local/tree/3.28.0"
}, },
"funding": [ "time": "2024-05-06T20:05:52+00:00"
{
"url": "https://ecologi.com/frankdejonge",
"type": "custom"
},
{
"url": "https://github.com/frankdejonge",
"type": "github"
}
],
"time": "2024-03-15T19:58:44+00:00"
}, },
{ {
"name": "league/mime-type-detection", "name": "league/mime-type-detection",
@ -2754,16 +2737,16 @@
}, },
{ {
"name": "livewire/livewire", "name": "livewire/livewire",
"version": "v3.4.12", "version": "v3.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/livewire/livewire.git", "url": "https://github.com/livewire/livewire.git",
"reference": "54dd265c17f7b5200627eb9690590e7cbbad1027" "reference": "72e900825c560f0e4e620185b26c5441a8914435"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/livewire/livewire/zipball/54dd265c17f7b5200627eb9690590e7cbbad1027", "url": "https://api.github.com/repos/livewire/livewire/zipball/72e900825c560f0e4e620185b26c5441a8914435",
"reference": "54dd265c17f7b5200627eb9690590e7cbbad1027", "reference": "72e900825c560f0e4e620185b26c5441a8914435",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2818,7 +2801,7 @@
"description": "A front-end framework for Laravel.", "description": "A front-end framework for Laravel.",
"support": { "support": {
"issues": "https://github.com/livewire/livewire/issues", "issues": "https://github.com/livewire/livewire/issues",
"source": "https://github.com/livewire/livewire/tree/v3.4.12" "source": "https://github.com/livewire/livewire/tree/v3.5.0"
}, },
"funding": [ "funding": [
{ {
@ -2826,7 +2809,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-05-02T17:10:37+00:00" "time": "2024-05-21T13:39:04+00:00"
}, },
{ {
"name": "mobiledetect/mobiledetectlib", "name": "mobiledetect/mobiledetectlib",
@ -2995,16 +2978,16 @@
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "3.3.1", "version": "3.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/briannesbitt/Carbon.git",
"reference": "8ff64b92c1b1ec84fcde9f8bb9ff2ca34cb8a77a" "reference": "8eab8983c83c30e0bacbef8d311e3f3b8172727f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8ff64b92c1b1ec84fcde9f8bb9ff2ca34cb8a77a", "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8eab8983c83c30e0bacbef8d311e3f3b8172727f",
"reference": "8ff64b92c1b1ec84fcde9f8bb9ff2ca34cb8a77a", "reference": "8eab8983c83c30e0bacbef8d311e3f3b8172727f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3097,7 +3080,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-01T06:54:22+00:00" "time": "2024-05-24T14:26:34+00:00"
}, },
{ {
"name": "nette/schema", "name": "nette/schema",
@ -7440,16 +7423,16 @@
}, },
{ {
"name": "larastan/larastan", "name": "larastan/larastan",
"version": "v2.9.6", "version": "v2.9.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/larastan/larastan.git", "url": "https://github.com/larastan/larastan.git",
"reference": "93d5b95d2e29cdb8203363d44abfdbc0bc7ef57f" "reference": "5c805f636095cc2e0b659e3954775cf8f1dad1bb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/larastan/larastan/zipball/93d5b95d2e29cdb8203363d44abfdbc0bc7ef57f", "url": "https://api.github.com/repos/larastan/larastan/zipball/5c805f636095cc2e0b659e3954775cf8f1dad1bb",
"reference": "93d5b95d2e29cdb8203363d44abfdbc0bc7ef57f", "reference": "5c805f636095cc2e0b659e3954775cf8f1dad1bb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -7463,7 +7446,7 @@
"illuminate/support": "^9.52.16 || ^10.28.0 || ^11.0", "illuminate/support": "^9.52.16 || ^10.28.0 || ^11.0",
"php": "^8.0.2", "php": "^8.0.2",
"phpmyadmin/sql-parser": "^5.9.0", "phpmyadmin/sql-parser": "^5.9.0",
"phpstan/phpstan": "^1.10.66" "phpstan/phpstan": "^1.11.1"
}, },
"require-dev": { "require-dev": {
"doctrine/coding-standard": "^12.0", "doctrine/coding-standard": "^12.0",
@ -7518,7 +7501,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/larastan/larastan/issues", "issues": "https://github.com/larastan/larastan/issues",
"source": "https://github.com/larastan/larastan/tree/v2.9.6" "source": "https://github.com/larastan/larastan/tree/v2.9.7"
}, },
"funding": [ "funding": [
{ {
@ -7538,7 +7521,7 @@
"type": "patreon" "type": "patreon"
} }
], ],
"time": "2024-05-09T11:53:26+00:00" "time": "2024-05-27T18:33:26+00:00"
}, },
{ {
"name": "laravel/pint", "name": "laravel/pint",
@ -8121,16 +8104,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.11.1", "version": "1.11.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b" "reference": "0d5d4294a70deb7547db655c47685d680e39cfec"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e524358f930e41a2b4cca1320e3b04fc26b39e0b", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec",
"reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b", "reference": "0d5d4294a70deb7547db655c47685d680e39cfec",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -8175,7 +8158,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-05-15T08:00:59+00:00" "time": "2024-05-24T13:23:04+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
@ -9588,16 +9571,16 @@
}, },
{ {
"name": "spatie/flare-client-php", "name": "spatie/flare-client-php",
"version": "1.5.1", "version": "1.6.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/spatie/flare-client-php.git", "url": "https://github.com/spatie/flare-client-php.git",
"reference": "e27977d534eefe04c154c6fd8460217024054c05" "reference": "220a7c8745e9fa427d54099f47147c4b97fe6462"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/spatie/flare-client-php/zipball/e27977d534eefe04c154c6fd8460217024054c05", "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/220a7c8745e9fa427d54099f47147c4b97fe6462",
"reference": "e27977d534eefe04c154c6fd8460217024054c05", "reference": "220a7c8745e9fa427d54099f47147c4b97fe6462",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -9645,7 +9628,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/spatie/flare-client-php/issues", "issues": "https://github.com/spatie/flare-client-php/issues",
"source": "https://github.com/spatie/flare-client-php/tree/1.5.1" "source": "https://github.com/spatie/flare-client-php/tree/1.6.0"
}, },
"funding": [ "funding": [
{ {
@ -9653,7 +9636,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-05-03T15:43:14+00:00" "time": "2024-05-22T09:45:39+00:00"
}, },
{ {
"name": "spatie/ignition", "name": "spatie/ignition",
@ -9887,7 +9870,8 @@
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^8.3" "php": "^8.3",
"ext-curl": "*"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.6.0" "plugin-api-version": "2.6.0"

View File

@ -14,8 +14,8 @@ return new class extends Migration
if (config('database.default') === 'mysql') { if (config('database.default') === 'mysql') {
// https://www.drupal.org/project/natsort // https://www.drupal.org/project/natsort
DB::unprepared(" DB::unprepared("
DROP FUNCTION IF EXISTS naturalsort; DROP FUNCTION IF EXISTS naturalSort;
CREATE FUNCTION naturalsort (s VARCHAR (255)) RETURNS VARCHAR (255) NO SQL DETERMINISTIC BEGIN CREATE FUNCTION naturalSort (s VARCHAR (255)) RETURNS VARCHAR (255) NO SQL DETERMINISTIC BEGIN
DECLARE orig VARCHAR (255) DEFAULT s; DECLARE orig VARCHAR (255) DEFAULT s;
DECLARE ret VARCHAR (255) DEFAULT ''; DECLARE ret VARCHAR (255) DEFAULT '';
IF s IS NULL THEN IF s IS NULL THEN
@ -58,7 +58,7 @@ return new class extends Migration
if (config('database.default') === 'pgsql') { if (config('database.default') === 'pgsql') {
// http://www.rhodiumtoad.org.uk/junk/naturalsort.sql // http://www.rhodiumtoad.org.uk/junk/naturalsort.sql
DB::unprepared(' DB::unprepared('
create or replace function naturalsort(text) create or replace function naturalSort(text)
returns bytea language sql immutable strict as returns bytea language sql immutable strict as
$f$ select string_agg(convert_to(coalesce(r[2],length(length(r[1])::text) || length(r[1])::text || r[1]),\'SQL_ASCII\'),\'\x00\') $f$ select string_agg(convert_to(coalesce(r[2],length(length(r[1])::text) || length(r[1])::text || r[1]),\'SQL_ASCII\'),\'\x00\')
from regexp_matches($1, \'0*([0-9]+)|([^0-9]+)\', \'g\') r; $f$; from regexp_matches($1, \'0*([0-9]+)|([^0-9]+)\', \'g\') r; $f$;
@ -73,7 +73,7 @@ return new class extends Migration
} }
if (config('database.default') === 'mysql' || config('database.default') === 'pgsql') { if (config('database.default') === 'mysql' || config('database.default') === 'pgsql') {
DB::unprepared('DROP FUNCTION IF EXISTS naturalsort'); DB::unprepared('DROP FUNCTION IF EXISTS naturalSort');
} }
} }
}; };

View File

@ -22,7 +22,7 @@
<env name="APP_MAINTENANCE_DRIVER" value="file"/> <env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/> <env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_STORE" value="array"/> <env name="CACHE_STORE" value="array"/>
<env name="DB_DATABASE" value="testing"/> <env name="DB_DATABASE" value="test"/>
<env name="MAIL_MAILER" value="array"/> <env name="MAIL_MAILER" value="array"/>
<env name="PULSE_ENABLED" value="false"/> <env name="PULSE_ENABLED" value="false"/>
<env name="QUEUE_CONNECTION" value="sync"/> <env name="QUEUE_CONNECTION" value="sync"/>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
{ {
"/app.js": "/app.js?id=39a6748854b6a3067197328ad5a1bdbb", "/app.js": "/app.js?id=d5c07e2eeefdadf9650a9473ea340c89",
"/manifest.js": "/manifest.js?id=d6d76d12b7219df564489d400c711198", "/manifest.js": "/manifest.js?id=d6d76d12b7219df564489d400c711198",
"/app.css": "/app.css?id=3d962b859bf103c1663adb9513497f17", "/app.css": "/app.css?id=3d962b859bf103c1663adb9513497f17",
"/vendor.js": "/vendor.js?id=3a6808f0337dd41e7423cb4bc7c703d3", "/vendor.js": "/vendor.js?id=0b026297072f6c8be97d0c900a2d4770",
"/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2?id=c8390e146be0a3c8a5498355dec892ae", "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2?id=c8390e146be0a3c8a5498355dec892ae",
"/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2?id=b0735c7dd6126471acbaf9d6e9f5e41a", "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2?id=b0735c7dd6126471acbaf9d6e9f5e41a",
"/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty1ciurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty1ciurt9w6fk2a.woff2?id=7c1fb232e3050e36dcc1aee61f1d0c06", "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty1ciurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty1ciurt9w6fk2a.woff2?id=7c1fb232e3050e36dcc1aee61f1d0c06",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,13 @@
<p {{ $attributes->class(['text-slate-700 dark:text-gray-300 text-sm']) }}>
<span>{{ Number::format($mod->total_downloads) }} downloads</span>
@if(!is_null($mod->created_at))
<span>
&mdash; Created
<time datetime="{{ $mod->created_at->format('c') }}">
{{ $mod->created_at->diffForHumans() }}
</time>
</span>
@elseif(!is_null($modVersion->updated_at))
<span>&mdash; Updated {{ $modVersion->updated_at->diffForHumans() }}</span>
@endif
</p>

View File

@ -21,17 +21,10 @@
{{ $mod->{$versionScope}->sptVersion->version }} {{ $mod->{$versionScope}->sptVersion->version }}
</span> </span>
</div> </div>
<p class="text-sm italic text-slate-600 dark:text-gray-200">By {{ $mod->user->name }}</p>
<p class="mt-2 text-slate-500 dark:text-gray-300">{{ $mod->teaser }}</p> <p class="mt-2 text-slate-500 dark:text-gray-300">{{ $mod->teaser }}</p>
</div> </div>
<p class="text-slate-700 dark:text-gray-300 text-sm"> <x-mod-list-stats :mod="$mod" :modVersion="$mod->{$versionScope}" />
<span>By {{ $mod->user->name }}</span>
@if (!is_null($mod->total_downloads))
<span>&ndash; {{ Number::format($mod->total_downloads) }} downloads</span>
@endif
@if(!is_null($mod->updated_at))
<span>&ndash; updated {{ $mod->updated_at }}</span>
@endif
</p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -14,7 +14,7 @@
</div> </div>
<div class="mx-auto max-w-2xl text-center"> <div class="mx-auto max-w-2xl text-center">
<h2 class="text-4xl font-bold tracking-tight text-white sm:text-6xl drop-shadow-md">Step into <h2 class="text-4xl font-bold tracking-tight text-white sm:text-6xl drop-shadow-md">Step into
<em class="dark:text-gray-400">{{ config('app.name', 'The Forge') }}</em></h2> <em class="text-gray-200">{{ config('app.name', 'The Forge') }}</em></h2>
<p class="mt-6 text-lg leading-8 text-gray-300 drop-shadow-md">The greatest resource available for Single Player Tarkov modifications. Where modding legends are made. Discover powerful tools, expert-written guides, and exclusive mods. Craft your vision. Transform the game.</p> <p class="mt-6 text-lg leading-8 text-gray-300 drop-shadow-md">The greatest resource available for Single Player Tarkov modifications. Where modding legends are made. Discover powerful tools, expert-written guides, and exclusive mods. Craft your vision. Transform the game.</p>
</div> </div>
</div> </div>

View File

@ -0,0 +1,30 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Mod Details') }}
</h2>
</x-slot>
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white dark:bg-gray-900 overflow-hidden shadow-xl dark:shadow-gray-900 sm:rounded-lg">
<div class="grid grid-cols-2 gap-6">
<div>
<div>
<img src="{{ $mod->thumbnail }}" alt="{{ $mod->name }}" />
<h2>{{ $mod->name }}</h2>
<p>{{ $mod->latestSptVersion->sptVersion->version }}</p>
<p>{{ $mod->user->name }}</p>
<p>{{ $mod->total_downloads }}</p>
</div>
<div>
<a href="{{ $mod->latestSptVersion->link }}">{{ __('Download') }}</a>
</div>
</div>
<div>
<h2>{{ __('Details') }}</h2>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -1,14 +1,16 @@
<?php <?php
use App\Http\Controllers\ModController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
Route::get('/', function () { Route::get('/', function () {
return view('home'); return view('home');
})->name('home'); })->name('home');
Route::get('/mods', function () { Route::controller(ModController::class)->group(function () {
return ''; Route::get('/mods', 'index')->name('mods');
})->name('mods'); Route::get('/mod/{mod}/{slug}', 'show')->where(['id' => '[0-9]+'])->name('mod.show');
});
Route::middleware(['auth:sanctum', config('jetstream.auth_session'), 'verified'])->group(function () { Route::middleware(['auth:sanctum', config('jetstream.auth_session'), 'verified'])->group(function () {
Route::get('/dashboard', function () { Route::get('/dashboard', function () {