public function register() { $this->ioc->singleton(SessionManager::class, function () { $manager = new SessionManager(); $manager->setHandler($this->ioc->make(TransientSessionStorage::class)); return $manager; }); }
public function register() { $def = new EntityDefinition(Session::class); $def->id(Sha256StrongHash::class)->mapsTo('token'); $def->required('data', Text::class); $def->timestamps(); $this->remodel->register($def); $this->ioc->singleton(SessionGateway::class, SessionGateway::class); $this->ioc->singleton(SessionRepository::class, SessionRepository::class); $this->ioc->singleton(SessionManager::class, function () { $manager = new SessionManager(); $manager->setHandler($this->ioc->make(DatabaseSessionStorage::class)); return $manager; }); }