some progress
This commit is contained in:
@@ -81,12 +81,12 @@ class GameController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$games = $query->paginate(12)->withQueryString();
|
||||
$games = $query->paginate(36)->withQueryString();
|
||||
|
||||
// Get data for filter dropdowns
|
||||
$platforms = \App\Models\Platform::orderBy('name')->get();
|
||||
$genres = \App\Models\Genre::orderBy('name')->get();
|
||||
|
||||
|
||||
// Get unique years from games
|
||||
$years = Game::selectRaw('YEAR(first_release_date) as year')
|
||||
->whereNotNull('first_release_date')
|
||||
|
||||
@@ -6,12 +6,13 @@ use App\Models\Game;
|
||||
use App\Models\GameList;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class GameListController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
//$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,8 +55,9 @@ class GameListController extends Controller
|
||||
*/
|
||||
public function show(GameList $list)
|
||||
{
|
||||
$this->authorize('view', $list);
|
||||
|
||||
//$this->authorize('view', $list);
|
||||
Gate::authorize('view', $list);
|
||||
|
||||
$games = $list->games()->paginate(12);
|
||||
return view('lists.show', compact('list', 'games'));
|
||||
}
|
||||
@@ -106,7 +108,7 @@ class GameListController extends Controller
|
||||
|
||||
public function addGame(Request $request, GameList $list)
|
||||
{
|
||||
$this->authorize('update', $list);
|
||||
Gate::authorize('update', $list);
|
||||
|
||||
$request->validate([
|
||||
'game_id' => 'required|exists:games,id'
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('index');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners;
|
||||
|
||||
use App\Models\Wishlist;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
|
||||
class CreateDefaultUsersListListener
|
||||
{
|
||||
public const DEFAULT_LISTS = [
|
||||
'played',
|
||||
'playing',
|
||||
'backlog',
|
||||
'wishlist',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create the event listener.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*/
|
||||
public function handle(Registered $event): void
|
||||
{
|
||||
foreach (self::DEFAULT_LISTS as $listName) {
|
||||
Wishlist::create([
|
||||
'user_id' => $event->user->id,
|
||||
'name' => $listName,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,8 @@ class GameList extends Model
|
||||
|
||||
public function games(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Game::class)->withTimestamps();
|
||||
return $this->belongsToMany(Game::class)
|
||||
->with(['platforms'])
|
||||
->withTimestamps();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ class Rating extends Model
|
||||
'user_id',
|
||||
'game_id',
|
||||
'rating',
|
||||
'platform',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
@@ -29,4 +30,4 @@ class Rating extends Model
|
||||
{
|
||||
return $this->belongsTo(Game::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ class Review extends Model
|
||||
'content',
|
||||
'recommended',
|
||||
'rating',
|
||||
'platform',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Wishlist extends Model
|
||||
{
|
||||
public const VISIBILITY_PUBLIC = 'public';
|
||||
public const VISIBILITY_PRIVATE = 'private';
|
||||
public const VISIBILITY_FRIENDS_ONLY = 'friends_only';
|
||||
|
||||
public const VISIBILITIES = [
|
||||
self::VISIBILITY_PUBLIC,
|
||||
self::VISIBILITY_PRIVATE,
|
||||
self::VISIBILITY_FRIENDS_ONLY,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'name',
|
||||
'description',
|
||||
'visibility',
|
||||
];
|
||||
}
|
||||
@@ -16,15 +16,17 @@ class GameListPolicy
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
// check if list is public
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, GameList $list)
|
||||
public function view(User $user, GameList $list): bool
|
||||
{
|
||||
return $user->id === $list->user_id;
|
||||
//return $user->id === $list->user_id;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\GameList;
|
||||
use App\Policies\GameListPolicy;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@@ -21,5 +24,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function boot(): void
|
||||
{
|
||||
Paginator::useBootstrap();
|
||||
Gate::policy(GameList::class, GameListPolicy::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"marcreichel/igdb-laravel": "^5.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.15",
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel/breeze": "^2.3",
|
||||
"laravel/pail": "^1.2.2",
|
||||
|
||||
Generated
+156
-1
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "7b46d7d171bc99166a5acfa33ef476cb",
|
||||
"content-hash": "0814da2c93b6041a9dc275ff1eda9043",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brick/math",
|
||||
@@ -5894,6 +5894,91 @@
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "barryvdh/laravel-debugbar",
|
||||
"version": "v3.15.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/barryvdh/laravel-debugbar.git",
|
||||
"reference": "c0667ea91f7185f1e074402c5788195e96bf8106"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/c0667ea91f7185f1e074402c5788195e96bf8106",
|
||||
"reference": "c0667ea91f7185f1e074402c5788195e96bf8106",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/routing": "^9|^10|^11|^12",
|
||||
"illuminate/session": "^9|^10|^11|^12",
|
||||
"illuminate/support": "^9|^10|^11|^12",
|
||||
"php": "^8.1",
|
||||
"php-debugbar/php-debugbar": "~2.1.1",
|
||||
"symfony/finder": "^6|^7"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.3.3",
|
||||
"orchestra/testbench-dusk": "^7|^8|^9|^10",
|
||||
"phpunit/phpunit": "^9.5.10|^10|^11",
|
||||
"squizlabs/php_codesniffer": "^3.5"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"aliases": {
|
||||
"Debugbar": "Barryvdh\\Debugbar\\Facades\\Debugbar"
|
||||
},
|
||||
"providers": [
|
||||
"Barryvdh\\Debugbar\\ServiceProvider"
|
||||
]
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "3.15-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Barryvdh\\Debugbar\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Barry vd. Heuvel",
|
||||
"email": "barryvdh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP Debugbar integration for Laravel",
|
||||
"keywords": [
|
||||
"debug",
|
||||
"debugbar",
|
||||
"dev",
|
||||
"laravel",
|
||||
"profiler",
|
||||
"webprofiler"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/barryvdh/laravel-debugbar/issues",
|
||||
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.15.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://fruitcake.nl",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/barryvdh",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-04-16T06:32:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fakerphp/faker",
|
||||
"version": "v1.24.1",
|
||||
@@ -6707,6 +6792,76 @@
|
||||
},
|
||||
"time": "2022-02-21T01:04:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-debugbar/php-debugbar",
|
||||
"version": "v2.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-debugbar/php-debugbar.git",
|
||||
"reference": "16fa68da5617220594aa5e33fa9de415f94784a0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/16fa68da5617220594aa5e33fa9de415f94784a0",
|
||||
"reference": "16fa68da5617220594aa5e33fa9de415f94784a0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^8",
|
||||
"psr/log": "^1|^2|^3",
|
||||
"symfony/var-dumper": "^4|^5|^6|^7"
|
||||
},
|
||||
"require-dev": {
|
||||
"dbrekelmans/bdi": "^1",
|
||||
"phpunit/phpunit": "^8|^9",
|
||||
"symfony/panther": "^1|^2.1",
|
||||
"twig/twig": "^1.38|^2.7|^3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"kriswallsmith/assetic": "The best way to manage assets",
|
||||
"monolog/monolog": "Log using Monolog",
|
||||
"predis/predis": "Redis storage"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"DebugBar\\": "src/DebugBar/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Maxime Bouroumeau-Fuseau",
|
||||
"email": "maxime.bouroumeau@gmail.com",
|
||||
"homepage": "http://maximebf.com"
|
||||
},
|
||||
{
|
||||
"name": "Barry vd. Heuvel",
|
||||
"email": "barryvdh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Debug bar in the browser for php application",
|
||||
"homepage": "https://github.com/php-debugbar/php-debugbar",
|
||||
"keywords": [
|
||||
"debug",
|
||||
"debug bar",
|
||||
"debugbar",
|
||||
"dev"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
|
||||
"source": "https://github.com/php-debugbar/php-debugbar/tree/v2.1.6"
|
||||
},
|
||||
"time": "2025-02-21T17:47:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "11.0.9",
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ratings', function (Blueprint $table) {
|
||||
$table->string('platform');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ratings', function (Blueprint $table) {
|
||||
$table->dropColumn('platform');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('reviews', function (Blueprint $table) {
|
||||
$table->string('platform');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('reviews', function (Blueprint $table) {
|
||||
$table->dropColumn('platform');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('wishlists', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->bigInteger('user_id');
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
$table->enum('visibility', ['public', 'private', 'friends_only'])->default('public');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('wishlists');
|
||||
}
|
||||
};
|
||||
@@ -228,3 +228,19 @@ body {
|
||||
.dropdown-divider {
|
||||
border-top: 1px solid #334155;
|
||||
}
|
||||
|
||||
.cover-container{
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.cover-container a:hover+.game-info-cover{
|
||||
display: flex;
|
||||
}
|
||||
.cover-container .game-info-cover{
|
||||
border: 1px solid #000;
|
||||
margin-left: 10px;
|
||||
position: absolute; top: 0; left: 0;
|
||||
width: 100%; height: 100%;
|
||||
color: #fff; background: rgba(0, 0, 0, 0.7);
|
||||
display: none; justify-content: center; align-items: center;
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
<h1 class="h2 fw-bold gradient-text">All Games</h1>
|
||||
<div class="d-flex gap-2">
|
||||
<form action="{{ route('games.index') }}" method="GET" class="d-flex me-2">
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control bg-dark text-white border-0"
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control bg-dark text-white border-0"
|
||||
placeholder="Search games..."
|
||||
value="{{ request('search') }}"
|
||||
style="min-width: 250px;">
|
||||
@@ -92,7 +92,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(request()->hasAny(['platform', 'genre', 'year', 'rating_range']))
|
||||
@if(request()->hasAny(['platform', 'genre', 'year ', 'rating_range']))
|
||||
<div class="mb-4">
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
@if(request('platform'))
|
||||
@@ -123,35 +123,48 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4 g-4">
|
||||
<div class="row g-4">
|
||||
@foreach($games as $game)
|
||||
<div class="col">
|
||||
<div class="card gradient-border h-100">
|
||||
<img src="{{ $game->cover_url ?? 'https://via.placeholder.com/300x400' }}"
|
||||
class="card-img-top"
|
||||
alt="{{ $game->name }}"
|
||||
style="height: 300px; object-fit: cover;">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ $game->name }}</h5>
|
||||
<p class="card-text text-gray-400 small">
|
||||
{{ Str::limit($game->summary, 100) }}
|
||||
</p>
|
||||
<div class="d-flex gap-2 mb-3">
|
||||
@if($game->rating)
|
||||
<span class="badge bg-primary"><i class="fas fa-star me-1"></i> {{ number_format($game->rating, 1) }}</span>
|
||||
@endif
|
||||
@if($game->first_release_date)
|
||||
<span class="badge bg-secondary">
|
||||
<i class="fas fa-calendar-alt me-1"></i> {{ \Carbon\Carbon::parse($game->first_release_date)->format('Y') }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<a href="{{ route('games.show', $game->slug) }}" class="btn btn-gradient w-100">
|
||||
<i class="fas fa-info-circle me-1"></i> View Details
|
||||
<div class="col-md-2">
|
||||
<div class="cover-container">
|
||||
<a href="{{ route('games.show', $game->slug) }}">
|
||||
<img src="{{ $game->cover_url ?? 'https://via.placeholder.com/300x400' }}"
|
||||
class="card-img-top"
|
||||
alt="{{ $game->name }}"
|
||||
style="height: 300px; object-fit: cover;">
|
||||
<div class="game-info-cover">
|
||||
text here
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div class="col">--}}
|
||||
{{-- <div class="card gradient-border h-100">--}}
|
||||
{{-- <img src="{{ $game->cover_url ?? 'https://via.placeholder.com/300x400' }}"--}}
|
||||
{{-- class="card-img-top"--}}
|
||||
{{-- alt="{{ $game->name }}"--}}
|
||||
{{-- style="height: 300px; object-fit: cover;">--}}
|
||||
{{-- <div class="card-body">--}}
|
||||
{{-- <h5 class="card-title">{{ $game->name }}</h5>--}}
|
||||
{{-- <p class="card-text text-gray-400 small">--}}
|
||||
{{-- {{ Str::limit($game->summary, 100) }}--}}
|
||||
{{-- </p>--}}
|
||||
{{-- <div class="d-flex gap-2 mb-3">--}}
|
||||
{{-- @if($game->rating)--}}
|
||||
{{-- <span class="badge bg-primary"><i class="fas fa-star me-1"></i> {{ number_format($game->rating, 1) }}</span>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- @if($game->first_release_date)--}}
|
||||
{{-- <span class="badge bg-secondary">--}}
|
||||
{{-- <i class="fas fa-calendar-alt me-1"></i> {{ \Carbon\Carbon::parse($game->first_release_date)->format('Y') }}--}}
|
||||
{{-- </span>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- </div>--}}
|
||||
{{-- <a href="{{ route('games.show', $game->slug) }}" class="btn btn-gradient w-100">--}}
|
||||
{{-- <i class="fas fa-info-circle me-1"></i> View Details--}}
|
||||
{{-- </a>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
|
||||
@@ -47,28 +47,40 @@
|
||||
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Details</h5>
|
||||
<h5 class="mb-0">Released on</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<h6 class="text-muted">Platforms</h6>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
@foreach($game->platforms()->get() as $platform)
|
||||
<span class="badge bg-secondary">{{ $platform->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Genres</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<h6 class="text-muted">Genres</h6>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
@foreach($game->genres()->get() as $genre)
|
||||
<span class="badge bg-primary">{{ $genre->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($game->rating)
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Details</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($game->rating)
|
||||
<div class="mb-3">
|
||||
<h6 class="text-muted">Rating</h6>
|
||||
<div class="d-flex align-items-center">
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'ClearGame - Track Your Games. Level Up Your Backlog.')
|
||||
|
||||
@section('content')
|
||||
<section class="text-center py-5">
|
||||
<h1 class="display-4 fw-bold mb-4">
|
||||
<span class="gradient-text">Track Your Games.</span><br>
|
||||
Level Up Your Backlog.
|
||||
</h1>
|
||||
<p class="lead text-gray-400 mb-5 mx-auto" style="max-width: 600px;">
|
||||
Organize your gaming journey, discover new titles, and connect with fellow gamers.
|
||||
Your ultimate companion for managing and completing your game collection.
|
||||
</p>
|
||||
<div class="d-flex justify-content-center gap-3">
|
||||
<a href="#" class="btn btn-gradient btn-lg">Get Started</a>
|
||||
<a href="#" class="btn btn-outline-gradient btn-lg">Learn More</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="py-5">
|
||||
<div class="row g-4">
|
||||
<div class="col-md-4">
|
||||
<div class="gradient-border p-4 rounded-3 h-100">
|
||||
<div class="display-4 mb-3 gradient-text">🎮</div>
|
||||
<h3 class="h4 fw-semibold mb-2">Track Your Progress</h3>
|
||||
<p class="text-gray-400">Keep tabs on your gaming journey and celebrate your achievements.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="gradient-border p-4 rounded-3 h-100">
|
||||
<div class="display-4 mb-3 gradient-text">📊</div>
|
||||
<h3 class="h4 fw-semibold mb-2">Discover New Games</h3>
|
||||
<p class="text-gray-400">Find your next favorite game with personalized recommendations.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="gradient-border p-4 rounded-3 h-100">
|
||||
<div class="display-4 mb-3 gradient-text">👥</div>
|
||||
<h3 class="h4 fw-semibold mb-2">Connect with Gamers</h3>
|
||||
<p class="text-gray-400">Share your experiences and connect with like-minded gamers.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="text-center py-5">
|
||||
<h2 class="display-5 fw-bold mb-4">Ready to Level Up Your Gaming Experience?</h2>
|
||||
<a href="#" class="btn btn-gradient btn-lg">Join ClearGame Today</a>
|
||||
</section>
|
||||
@endsection
|
||||
@@ -33,15 +33,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg">
|
||||
<div class="container">
|
||||
<a class="navbar-brand text-2xl fw-bold gradient-text" href="#">ClearGame</a>
|
||||
<div class="d-flex">
|
||||
<a href="#" class="text-gray-300 text-decoration-none me-3">Login</a>
|
||||
<a href="#" class="btn btn-gradient">Sign Up</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@include('layouts.navigation')
|
||||
|
||||
<main class="container">
|
||||
<section class="text-center py-5">
|
||||
@@ -97,4 +89,4 @@
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -19,7 +19,29 @@
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--primary: #7F00FF;
|
||||
--accent: #00C9FF;
|
||||
--background: #121212;
|
||||
--text: #EAEAEA;
|
||||
}
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: var(--background);
|
||||
color: var(--text);
|
||||
}
|
||||
.gradient-text {
|
||||
background: linear-gradient(90deg, var(--primary), var(--accent));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
.gradient-border {
|
||||
border: 2px solid transparent;
|
||||
background: linear-gradient(var(--background), var(--background)) padding-box,
|
||||
linear-gradient(90deg, var(--primary), var(--accent)) border-box;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="font-sans antialiased">
|
||||
<div class="min-h-screen bg-gray-100 dark:bg-gray-900">
|
||||
@@ -44,6 +66,9 @@
|
||||
<i class="fas fa-user me-1"></i> {{ Auth::user()->name }}
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<a href="">My lists</a>
|
||||
</li>
|
||||
<li>
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
||||
@@ -19,38 +19,46 @@
|
||||
</div>
|
||||
|
||||
<!-- Settings Dropdown -->
|
||||
<div class="hidden sm:flex sm:items-center sm:ms-6">
|
||||
<x-dropdown align="right" width="48">
|
||||
<x-slot name="trigger">
|
||||
<button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300 focus:outline-none transition ease-in-out duration-150">
|
||||
<div>{{ Auth::user()->name }}</div>
|
||||
@auth
|
||||
<div class="hidden sm:flex sm:items-center sm:ms-6">
|
||||
<x-dropdown align="right" width="48">
|
||||
<x-slot name="trigger">
|
||||
<button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300 focus:outline-none transition ease-in-out duration-150">
|
||||
<div>{{ Auth::user()->name }}</div>
|
||||
|
||||
<div class="ms-1">
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
</button>
|
||||
</x-slot>
|
||||
<div class="ms-1">
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
</button>
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<x-dropdown-link :href="route('profile.edit')">
|
||||
{{ __('Profile') }}
|
||||
</x-dropdown-link>
|
||||
|
||||
<!-- Authentication -->
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
||||
<x-dropdown-link :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
{{ __('Log Out') }}
|
||||
<x-slot name="content">
|
||||
<x-dropdown-link :href="route('profile.edit')">
|
||||
{{ __('Profile') }}
|
||||
</x-dropdown-link>
|
||||
</form>
|
||||
</x-slot>
|
||||
</x-dropdown>
|
||||
</div>
|
||||
|
||||
<!-- Authentication -->
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
||||
<x-dropdown-link :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
{{ __('Log Out') }}
|
||||
</x-dropdown-link>
|
||||
</form>
|
||||
</x-slot>
|
||||
</x-dropdown>
|
||||
</div>
|
||||
@endauth
|
||||
@guest
|
||||
<div class="d-flex">
|
||||
<a href="#" class="text-gray-300 text-decoration-none me-3">Login</a>
|
||||
<a href="#" class="btn btn-gradient">Sign Up</a>
|
||||
</div>
|
||||
@endguest
|
||||
|
||||
<!-- Hamburger -->
|
||||
<div class="-me-2 flex items-center sm:hidden">
|
||||
|
||||
@@ -4,51 +4,65 @@
|
||||
|
||||
@section('content')
|
||||
<div class="container py-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="text-gradient">My Lists</h1>
|
||||
<a href="{{ route('lists.create') }}" class="btn btn-gradient">
|
||||
<i class="fas fa-plus me-2"></i>Create New List
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row g-4">
|
||||
@foreach($lists as $list)
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card bg-dark text-white h-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-start mb-3">
|
||||
<h5 class="card-title mb-0">{{ $list->name }}</h5>
|
||||
<span class="badge bg-secondary">{{ $list->games_count }} games</span>
|
||||
</div>
|
||||
@if($list->description)
|
||||
<p class="card-text text-muted">{{ $list->description }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-footer bg-dark border-top border-secondary">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<a href="{{ route('lists.show', $list) }}" class="btn btn-outline-primary btn-sm">
|
||||
<i class="fas fa-eye me-1"></i> View
|
||||
</a>
|
||||
@if(!$list->is_default)
|
||||
<div class="btn-group">
|
||||
<a href="{{ route('lists.edit', $list) }}" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="fas fa-edit me-1"></i> Edit
|
||||
</a>
|
||||
<form action="{{ route('lists.destroy', $list) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm"
|
||||
onclick="return confirm('Are you sure you want to delete this list?')">
|
||||
<i class="fas fa-trash me-1"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@if($lists->count())
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h1 class="text-gradient d-block float-start">My Lists</h1>
|
||||
<span class="float-end">
|
||||
<a href="{{ route('lists.create') }}" class="btn btn-gradient">
|
||||
<i class="fas fa-plus me-2"></i>Create New List
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@foreach($lists as $list)
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card bg-dark text-white h-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-start mb-3">
|
||||
<h5 class="card-title mb-0">{{ $list->name }}</h5>
|
||||
<span class="badge bg-secondary">{{ $list->games_count }} games</span>
|
||||
</div>
|
||||
@if($list->description)
|
||||
<p class="card-text text-muted">{{ $list->description }}</p>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<div class="card-footer bg-dark border-top border-secondary">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<a href="{{ route('lists.show', $list) }}" class="btn btn-outline-primary btn-sm">
|
||||
<i class="fas fa-eye me-1"></i> View
|
||||
</a>
|
||||
@if(!$list->is_default)
|
||||
<div class="btn-group">
|
||||
<a href="{{ route('lists.edit', $list) }}" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="fas fa-edit me-1"></i> Edit
|
||||
</a>
|
||||
<form action="{{ route('lists.destroy', $list) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm"
|
||||
onclick="return confirm('Are you sure you want to delete this list?')">
|
||||
<i class="fas fa-trash me-1"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@else
|
||||
no lists exists
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
+6
-3
@@ -1,14 +1,17 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\HomeController;
|
||||
use App\Http\Controllers\ProfileController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\GameController;
|
||||
use App\Http\Controllers\ReviewController;
|
||||
use App\Http\Controllers\GameListController;
|
||||
|
||||
Route::get('/', function () {
|
||||
return view('landing');
|
||||
});
|
||||
//Route::get('/', function () {
|
||||
// return view('landing');
|
||||
//});
|
||||
|
||||
Route::get('/', [HomeController::class, 'index']);
|
||||
|
||||
Route::get('/dashboard', function () {
|
||||
return view('dashboard');
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
Reference in New Issue
Block a user