Venue Page Dynamization - Implementation Plan

📄 General
← Back to Documentation
# Venue Page Dynamization - Implementation Plan ## 📋 Overview Comprehensive plan to make venue.blade.php fully dynamic with database-driven content. --- ## ✅ Existing Entities (Already in Database) ### 1. **Gallery & GalleryItem** - ✅ Gallery model exists with venue relationship - ✅ GalleryItem model exists with image_path, title, description - ✅ Relationship: Venue → hasMany(Gallery) → hasMany(GalleryItem) ### 2. **Facility & VenueFacility** - ✅ Facility model exists (general facilities catalog) - ✅ VenueFacility model exists (pivot with venue_id, facility_id) - ✅ Relationship: Venue → hasMany(VenueFacility) → belongsTo(Facility) --- ## 🔧 Required Database Changes ### 1. **Add manager_name to venues table** ```sql ALTER TABLE venues ADD COLUMN manager_name VARCHAR(255) NULL AFTER name; ``` ### 2. **Add house_rules to venues table** ```sql ALTER TABLE venues ADD COLUMN house_rules TEXT NULL; ``` ### 3. **Add payment_methods to venues table** ```sql ALTER TABLE venues ADD COLUMN payment_methods JSON NULL; ALTER TABLE venues ADD COLUMN payment_credentials JSON NULL; ``` --- ## 📝 Implementation Tasks ### Phase 1: Database & Models ✅ #### Task 1.1: Create Migration for Venue Fields - [x] Add manager_name field - [x] Add house_rules field - [x] Add payment_methods JSON field - [x] Add payment_credentials JSON field #### Task 1.2: Update Venue Model - [x] Add fillable fields - [x] Add casts for JSON fields - [x] Add gallery() relationship (if missing) - [x] Add facilities() relationship through venueFacilities #### Task 1.3: Verify Existing Relationships - [x] Gallery → Venue relationship - [x] GalleryItem → Gallery relationship - [x] Facility → VenueFacility relationship - [x] VenueFacility → Venue relationship --- ### Phase 2: Admin Panel Forms #### Task 2.1: Update VenueForm - [ ] Add manager_name TextInput - [ ] Add house_rules Textarea with rich text editor - [ ] Add facilities CheckboxList (multiple selection) - [ ] Add PaymentSettings section with: - [ ] Payment methods multi-select - [ ] Conditional credential inputs per method - [ ] MyPOS credentials (client_id, secret) - [ ] PayPal credentials (client_id, secret) - [ ] Stripe credentials (publishable_key, secret_key) #### Task 2.2: Gallery Management - [ ] Verify GalleryResource exists and works - [ ] Ensure gallery items can be uploaded and sorted - [ ] Add gallery section to VenueForm (relationship manager) --- ### Phase 3: Frontend Dynamization #### Task 3.1: Hero Section & Gallery - [ ] Update venue.blade.php to load gallery from database - [ ] Show gallery items with lightbox - [ ] Fallback to placeholder if no gallery exists - [ ] Display manager_name from database #### Task 3.2: Facilities Section - [ ] Load facilities from venueFacilities relationship - [ ] Display facility icons and names - [ ] Group facilities by category - [ ] Show "No facilities" message if empty #### Task 3.3: Description Section - [ ] Load description from venue.description - [ ] Render HTML safely (if rich text) - [ ] Add character limit with "Read more" toggle #### Task 3.4: House Rules Section - [ ] Create new section for house rules - [ ] Load from venue.house_rules - [ ] Display as formatted list - [ ] Hide section if no rules exist #### Task 3.5: Payment Methods Section - [ ] Load payment_methods from database - [ ] Display payment method logos dynamically - [ ] Show only active payment methods - [ ] Add security badges (SSL, etc.) #### Task 3.6: Guest Reviews Section - [ ] Load reviews from venue.reviews relationship - [ ] Display all reviews with pagination - [ ] Add "Post Review" button with conditional logic: - [ ] Check if user is authenticated - [ ] Check if user has past booking for this venue - [ ] Show button only if both conditions met - [ ] Add review submission modal/form --- ### Phase 4: Payment Configuration #### Task 4.1: Create Payment Config File ```php // config/payment-methods.php return [ 'mypos' => [ 'name' => 'MyPOS', 'logo' => '/images/payments/mypos.png', 'credentials' => ['client_id', 'secret_key'], ], 'paypal' => [ 'name' => 'PayPal', 'logo' => '/images/payments/paypal.png', 'credentials' => ['client_id', 'secret_key'], ], // ... more methods ]; ``` #### Task 4.2: Payment Logos - [ ] Add payment method logos to public/images/payments/ - [ ] Create fallback logo for unknown methods --- ### Phase 5: Review System #### Task 5.1: Review Submission Logic - [ ] Create ReviewController with store() method - [ ] Validate user has past booking - [ ] Store review with rating, comment, date - [ ] Send notification to venue owner #### Task 5.2: Review Display - [ ] Show all reviews with user info - [ ] Display rating stars - [ ] Show review date - [ ] Add helpful/not helpful buttons --- ## 🎯 Success Criteria ### Gallery - ✅ Images load from database Gallery/GalleryItem - ✅ Lightbox works with database images - ✅ Fallback to placeholder if no gallery ### Manager Name - ✅ Shows from database if set - ✅ Fallback to "Venue Manager" if null ### Facilities - ✅ Load from venueFacilities relationship - ✅ Display with icons and names - ✅ Group by category ### House Rules - ✅ New section displays rules - ✅ Hidden if no rules set - ✅ Formatted as list ### Payment Methods - ✅ Load from database JSON - ✅ Display active methods only - ✅ Show logos dynamically ### Reviews - ✅ All reviews displayed - ✅ "Post Review" button shows conditionally - ✅ Review submission works - ✅ Validation prevents duplicate reviews --- ## 📊 Database Schema ### venues table (additions) ```sql manager_name VARCHAR(255) NULL house_rules TEXT NULL payment_methods JSON NULL payment_credentials JSON NULL ``` ### Existing tables (already working) - galleries (id, name, venue_id, is_active) - gallery_items (id, gallery_id, image_path, title, description) - facilities (id, name, icon, category, is_active) - venue_facilities (id, venue_id, facility_id) - reviews (id, venue_id, client_id, rating, comment) --- ## 🔄 Migration Order 1. ✅ Create venue fields migration 2. ✅ Update Venue model 3. ✅ Update VenueForm 4. ✅ Create payment config file 5. ✅ Update venue.blade.php 6. ✅ Test all dynamic content 7. ✅ Add review submission functionality --- ## 📝 Notes - Gallery and Facility entities already exist ✅ - Need to add venue relationship methods if missing - Payment credentials stored encrypted in JSON - House rules support markdown/HTML formatting - Review system needs booking validation logic --- ## 🚀 Next Steps 1. Create migration for new venue fields 2. Update Venue model with relationships 3. Update VenueForm with new sections 4. Update venue.blade.php to use dynamic data 5. Test thoroughly with real data 6. Add review submission functionality