thuraaung2493/laravel-config-types

A small wrapper types safe class for Laravel config.

v0.1.1 2023-11-09 09:45 UTC

This package is auto-updated.

Last update: 2024-04-09 10:43:42 UTC


README

It supports Laravel 9+ and PHP 8.2+

Installation

composer require thuraaung2493/laravel-config-types

Usage

// Facades
use Thuraaung\ConfigTypes\Facades\Config

  Config::string('app.name') // 'Laravel'

// Via Service Container

use Thuraaung\ConfigTypes\ConfigResolver;

class Example
{
  public function __construct(
    private readonly ConfigResolver $config,
  ) {}

  public function test(): string
  {
    return $this->config->string('app.name');
  }
}

$example = new Example();
$example->test() // 'Laravel'

Test

  composer test

License

This package is open-sourced software licensed under the MIT license