PHP code example of slimseed / framework

1. Go to this page and download the library: Download slimseed/framework library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

slimseed / framework example snippets


// Domain/Services/HealthCheckServiceInterface.php
interface HealthCheckServiceInterface
{
    public function checkHealth(): HealthCheckResult;
}

// Domain/Repositories/UserRepositoryInterface.php
interface UserRepositoryInterface
{
    public function save(User $user): void;
    public function findById(int $id): ?User;
    public function findByEmail(string $email): ?User;
}

// Infrastructure/Services/HealthCheckService.php
class HealthCheckService implements HealthCheckServiceInterface
{
    public function checkHealth(): HealthCheckResult
    {
        // Implementación específica
    }
}

// Infrastructure/Persistence/DoctrineUserRepository.php
class DoctrineUserRepository implements UserRepositoryInterface
{
    public function save(User $user): void
    {
        $this->entityManager->persist($user);
        $this->entityManager->flush();
    }
}

// Shared/Container/ContainerBuilder.php
HealthCheckServiceInterface::class => \DI\create(HealthCheckService::class)
UserRepositoryInterface::class => \DI\create(DoctrineUserRepository::class)

#[ORM\Entity]
#[ORM\Table(name: 'users')]
class User
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column(type: Types::INTEGER)]
    private ?int $id = null;

    #[ORM\Column(type: Types::STRING, length: 100, unique: true)]
    private string $email;

    #[ORM\Column(type: Types::STRING, length: 255)]
    private string $name;

    #[ORM\Column(type: Types::BOOLEAN)]
    private bool $isActive = true;
}
bash
# 1. Instalar paquete
composer or/slimseed/framework/install.php

# 3. Configurar base de datos en .env
nano .env

# 4. Ejecutar migraciones
composer run migrate

# 5. Iniciar servidor local
php -S localhost:8000 -t public

# 6. Visitar: http://localhost:8000
http
GET /api/health/history?from=2025-09-01&to=2025-09-30
bash
# Crear esquema de base de datos
docker-compose exec -T app bash -c "cd /var/www/html && php scripts/migrate.php"

# Resetear base de datos
docker-compose exec -T app bash -c "cd /var/www/html && php scripts/reset-db.php"