PHP code example of lemaur / laravel-typed-config

1. Go to this page and download the library: Download lemaur/laravel-typed-config library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lemaur / laravel-typed-config example snippets


$myValue = (string) config('my-app.my-value');
// or
$myValue = (string) config()->get('my-app.my-value'); 

$myValue = config()->string('my-app.my-value');

$name = config()->string('my-app.name');

$archived = config()->boolean('my-app.archived');

$count = config()->integer('my-app.count');

$amount = config()->float('my-app.amount');

$birthday = config()->date('my-app.birthday');

$elapsed = config()->date('my-app.elapsed', '!H:i', 'Europe/Madrid');

use App\Enums\Status;

$status = config()->enum('my-app.status', Status::class);

$data = config()->collect('my-app.data');