<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Statistiky\Providers;

use Illuminate\Support\ServiceProvider;
use Seka\Portal\Modul\Statistiky\Entities\Zaznam\ZaznamFactory;
use Seka\Portal\Modul\Statistiky\Repositories\ZaznamRepositoryContract;
use Seka\Portal\Modul\Statistiky\Repositories\Eloquent\ZaznamRepository;

/**
 * Class RepositoryServiceProvider
 *
 * @package Seka\Portal\Modul\Statistiky\Providers
 */
final class RepositoryServiceProvider extends ServiceProvider
{
    /**
     * @return void
     */
    public function register(): void
    {
        $this->app->bind(ZaznamRepositoryContract::class, ZaznamRepository::class);

        $this->app->bind('zaznamFactory', function ($app) {
            return new ZaznamFactory($app->make(ZaznamRepositoryContract::class));
        });
    }
}
