PHP code example of sheenazien8 / konstantiq

1. Go to this page and download the library: Download sheenazien8/konstantiq 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/ */

    

sheenazien8 / konstantiq example snippets




class SomeClass 
{
    // This method returns an array of status strings
    public function pain(): array
    {
        return [
            'Pending',
            'Failed',
            'Done'
        ];
    }

    // This method returns an array of status constants from PaymentStatus
    public function healthy(): array
    {
        return PaymentStatus::all()->toArray();
    }
}



namespace App\Constants;

use Sheenazien8\Konstantiq\ConstanstAbstraction;

class PaymentStatus extends ConstanstAbstraction
{
    // You can add the constants that you need
    const PENDING = 'pending';
    const DONE = 'done';
}

// Usage example
PaymentStatus::PENDING; // will return the 'pending' value
PaymentStatus::all(); // will return the all of the constants
bash
php artisan vendor:publish --tag="konstantiq-config"