I need to use the laravel component "Crypt" but separate without using the framework, I installed it via composer.
include 'vendor/autoload.php';
use Illuminate\Encryption;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Contracts\Encryption\DecryptException;
$encrypted = Crypt::encryptString('Hello world.');
$decrypted = Crypt::decryptString($encrypted);
It gives an error
Fatal error: Uncaught exception 'RuntimeException' with message 'A facade root has not been set.' in /var/www/html/exec/crypt/vendor/illuminate/support/Facades/Facade.php:218 Stack trace: # 0 /var/www/html/exec/crypt/index.php(14): Illuminate \ Support \ Facades \ Facade :: __ callStatic ('encryptString', Array) # 1 /var/www/html/exec/crypt/index.php(14): Illuminate \ Support \ Facades \ Crypt :: encryptString ('Hello world. ') # 2 {main} thrown in /var/www/html/exec/crypt/vendor/illuminate/support/Facades/Facade.php on line 218