Basics of auth
Some checks failed
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 2m31s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 2m24s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 2m57s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 3m14s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Failing after 2m58s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Failing after 1m24s

This commit is contained in:
2026-01-01 15:38:19 -05:00
parent 9f895bbb85
commit d0cee7b48f
35 changed files with 664 additions and 202 deletions

View File

@@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace Siteworxpro\App\Services\Facades;
use Siteworxpro\App\Services\Facade;
/**
* @method static string encrypt(string $data)
* @method static string decrypt(string $data)
*/
class Encryption extends Facade
{
protected static function getFacadeAccessor(): string
{
return \Siteworxpro\App\Helpers\Encryption::class;
}
}

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace Siteworxpro\App\Services\ServiceProviders;
use Illuminate\Support\ServiceProvider;
use Siteworxpro\App\Helpers\Encryption;
use Siteworxpro\App\Services\Facades\Config;
class EncryptionServiceProvider extends ServiceProvider
{
public function provides(): array
{
return [Encryption::class];
}
public function register(): void
{
$this->app->singleton(Encryption::class, function () {
$key = Config::get('app.encryption_key');
if (empty($key)) {
throw new \RuntimeException('Encryption key is not set in configuration.');
}
if (str_contains($key, 'base64:')) {
$key = base64_decode(substr($key, 7));
}
return new Encryption($key);
});
}
}