Add reviews, search autocomplete, SEO meta/schema, user lists
- Review system: ReviewController (store/update/destroy), ReviewPolicy, Review model boot() hooks, review form with Alpine.js (spoiler toggle, edit/delete UX) - Search autocomplete: Alpine.js searchWidget in nav with 300ms debounce, keyboard navigation, 6-result dropdown - SEO: og:image, twitter:card in layout; og sections + Schema.org VideoGame JSON-LD on game show pages - Custom lists: UserList/UserListGame models, ListController, ListPolicy, lists index/show views, Add-to-List button on game pages Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
93d869cf8c
commit
5c6ba86e15
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Game;
|
||||
use App\Models\Review;
|
||||
use App\Models\User;
|
||||
|
||||
class ReviewPolicy
|
||||
{
|
||||
public function create(User $user, Game $game): bool
|
||||
{
|
||||
return $user->library()->where('game_id', $game->id)->exists();
|
||||
}
|
||||
|
||||
public function update(User $user, Review $review): bool
|
||||
{
|
||||
return $user->id === $review->user_id;
|
||||
}
|
||||
|
||||
public function delete(User $user, Review $review): bool
|
||||
{
|
||||
return $user->id === $review->user_id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user