diff --git a/app/Http/Controllers/GameListController.php b/app/Http/Controllers/GameListController.php index e4a4435..f7a3c36 100644 --- a/app/Http/Controllers/GameListController.php +++ b/app/Http/Controllers/GameListController.php @@ -67,7 +67,8 @@ class GameListController extends Controller */ public function edit(GameList $list) { - $this->authorize('update', $list); + Gate::authorize('update', $list); + return view('lists.edit', compact('list')); } @@ -76,7 +77,7 @@ class GameListController extends Controller */ public function update(Request $request, GameList $list) { - $this->authorize('update', $list); + Gate::authorize('update', $list); $request->validate([ 'name' => 'required|string|max:255', @@ -96,7 +97,7 @@ class GameListController extends Controller */ public function destroy(GameList $list) { - $this->authorize('delete', $list); + Gate::authorize('delete', $list); if ($list->is_default) { return redirect()->back()->with('error', 'Cannot delete default lists.'); @@ -121,7 +122,7 @@ class GameListController extends Controller public function removeGame(GameList $list, Game $game) { - $this->authorize('update', $list); + Gate::authorize('update', $list); $list->games()->detach($game->id); diff --git a/app/Http/Controllers/ReviewController.php b/app/Http/Controllers/ReviewController.php index d462dda..19cd983 100644 --- a/app/Http/Controllers/ReviewController.php +++ b/app/Http/Controllers/ReviewController.php @@ -60,7 +60,7 @@ class ReviewController extends Controller $validated = $request->validate([ 'content' => 'required|string|min:10|max:1000', 'recommended' => 'required|boolean', - 'rating' => 'required|integer|between:1,10', + 'rating' => 'required|integer|between:1,20', ]); $review->update($validated); diff --git a/public/img/star-empty.svg b/public/img/star-empty.svg new file mode 100644 index 0000000..6629df8 --- /dev/null +++ b/public/img/star-empty.svg @@ -0,0 +1,3 @@ + diff --git a/public/img/star-full.svg b/public/img/star-full.svg new file mode 100644 index 0000000..6e69846 --- /dev/null +++ b/public/img/star-full.svg @@ -0,0 +1,3 @@ + diff --git a/resources/views/games/show.blade.php b/resources/views/games/show.blade.php index e3a89ff..233a546 100644 --- a/resources/views/games/show.blade.php +++ b/resources/views/games/show.blade.php @@ -3,150 +3,289 @@ @section('title', $game->name) @section('content') -
{{ $game->first_release_date->format('Y') }}
-{{ $game->summary }}
+{{ Str::limit($game->summary, 200) }}
+{{ $game->summary }}
+ @if($game->storyline) +{{ $game->storyline }}
+ @endif +No reviews yet. Be the first to review this game!
+No reviews yet. Be the first to review this game!
+ @auth + + Write a Review + + @else + + Login to Write a Review + + @endauth +Based on {{ $game->reviews->count() }} reviews
+