thuraaung2493 / laravel-config-types
A small wrapper types safe class for Laravel config.
v0.1.1
2023-11-09 09:45 UTC
Requires
- php: ^8.2
- illuminate/support: ^10.14
- nunomaduro/mock-final-classes: ^1.2
Requires (Dev)
- laravel/pint: ^1.10
- nunomaduro/larastan: ^2.0
- orchestra/testbench: ^8.5
- pestphp/pest: ^2.6
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