AthenaeumAthenaeum
Packages
  • next
  • current
  • v9.x
  • v8.x
  • v7.x
  • v6.x
  • v5.x
  • v4.x
  • v3.x
  • v2.x
  • v1.x
Changelog
GitHub
Packages
  • next
  • current
  • v9.x
  • v8.x
  • v7.x
  • v6.x
  • v5.x
  • v4.x
  • v3.x
  • v2.x
  • v1.x
Changelog
GitHub
  • Version 3.x

    • How to install
  • Config

    • Configuration Loader
  • Container

    • IoC Service Container
  • Dto

    • Data Transfer Object (DTO)
    • Create Interface
    • Implement DTO
    • Property overloading
    • Populate
    • Json
    • Nested DTOs
    • Array DTO
  • Http

    • Introduction
    • Http Clients
  • Properties

    • Properties Overload
  • Support

    • Support Introduction
    • Laravel Aware Of Helpers
    • Aware Of Properties
    • Aware-Of Component Generator
  • Testing

    • Testing Introduction
    • Laravel
    • Test Cases
    • Traits
  • Utils

    • Populate
    • Json
You are viewing documentation for an outdated version. It is no longer supported!

IoC Service Container

The \Aedart\Container\IoC is a slightly adapted version of Laravel's Service Container. Please make sure to read their documentation, before attempting to use this version.

Info

IoC stands for Inversion of control.

getInstance()

Creates or obtains existing Service Container instance. This method registers the IoC as the app instance within itself. Furthermore, the method also ensures to set the container as the "application" instance in Laravel's Facade.

These additions have been made to make it easier, when working with Laravel components outside a typical Laravel application.

use Aedart\Container\IoC;

$container = IoC::getInstance();

destroy()

When you destroy the Service Container, the destroy() method will ensure to clear all resolved instances, within the Facade component, before removing itself.

$container->destroy();

Onward

For additional information, please review the source code of this component.

Edit page
Last Updated: 08/02/2020, 09:56
Contributors: Alin Eugen Deac