Fix Laravel 5.5 compatibility issues - view helpers, collections, and auth routes

- Replace {{ url() }} with {{ url('/') }} in all blade templates to fix object-to-string conversion errors
- Update TeamStoreModel::selectTeamStoreGroupByCartKey() to use first() instead of get() for Laravel 5.5 Collections
- Fix TeamStoreController to access object properties directly instead of using array syntax [0]
- Update authentication routes to use Laravel 5.5 method names (showLoginForm, login, logout)
- Update login/register links from /auth/login to /login throughout views (navbar, app, auth pages)
- Verify cart, login, and register pages working with HTTP 200 status
This commit is contained in:
Frank John Begornia
2026-01-14 21:44:34 +08:00
parent 56f2f19422
commit 59fc920498
37 changed files with 4224 additions and 1536 deletions

88
test-laravel-5.5.sh Executable file
View File

@@ -0,0 +1,88 @@
#!/bin/bash
# Test Laravel 5.5 upgrade in Docker container
echo "========================================="
echo "Laravel 5.5 Upgrade Test Script"
echo "========================================="
echo ""
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Build the container
echo -e "${YELLOW}Step 1: Building Docker container with PHP 7.0...${NC}"
docker compose -f docker-compose.local.yml build app
if [ $? -ne 0 ]; then
echo -e "${RED}✗ Docker build failed${NC}"
exit 1
fi
echo -e "${GREEN}✓ Docker build successful${NC}"
echo ""
# Start the container
echo -e "${YELLOW}Step 2: Starting container...${NC}"
docker compose -f docker-compose.local.yml up -d app
if [ $? -ne 0 ]; then
echo -e "${RED}✗ Failed to start container${NC}"
exit 1
fi
echo -e "${GREEN}✓ Container started${NC}"
echo ""
# Wait for container to be ready
echo "Waiting for container to be ready..."
sleep 5
# Check PHP version
echo -e "${YELLOW}Step 3: Verifying PHP version...${NC}"
PHP_VERSION=$(docker compose -f docker-compose.local.yml exec -T app php -v | head -1)
echo "PHP Version: $PHP_VERSION"
echo ""
# Check Laravel version
echo -e "${YELLOW}Step 4: Verifying Laravel installation...${NC}"
LARAVEL_VERSION=$(docker compose -f docker-compose.local.yml exec -T app php artisan --version)
echo "Laravel Version: $LARAVEL_VERSION"
echo ""
# Test route:list
echo -e "${YELLOW}Step 5: Testing route:list command...${NC}"
docker compose -f docker-compose.local.yml exec -T app php artisan route:list 2>&1 | head -20
echo ""
# Check for errors in logs
echo -e "${YELLOW}Step 6: Checking for errors...${NC}"
docker compose -f docker-compose.local.yml logs app | grep -i error | tail -10
echo ""
# Final status
echo "========================================="
if docker compose -f docker-compose.local.yml exec -T app php artisan list > /dev/null 2>&1; then
echo -e "${GREEN}✓ Laravel 5.5 upgrade successful!${NC}"
echo -e "${GREEN} All artisan commands are working${NC}"
echo ""
echo "Next steps:"
echo " 1. Test the application: http://localhost:8080"
echo " 2. Check database migrations"
echo " 3. Test authentication flow"
echo " 4. Verify designer functionality"
else
echo -e "${RED}✗ Some issues detected${NC}"
echo "Check the logs above for details"
fi
echo "========================================="
# Keep container running
echo ""
echo "Container is running. Access it with:"
echo " docker compose -f docker-compose.local.yml exec app bash"
echo ""
echo "Stop with:"
echo " docker compose -f docker-compose.local.yml down"