#!/bin/bash


# Cek apakah migration sudah pernah dijalankan
if php artisan migrate:status | grep -q "| Y"; then
    echo "Database already migrated, skipping migration and seeding."
else
    echo "Running migrations and seeders..."
    php artisan migrate --force
    php artisan db:seed --force
fi

# Jalankan Laravel server
exec php artisan serve --host=0.0.0.0 --port=8080
