Added a new CryptographyContract interface and CryptographyString class that implements this contract. The CryptographyContract encapsulates the encryption and decryption of strings, enforcing these operations to be standardized across the application. The CryptographyString class uses Laravel's native crypt facades to perform these actions. In the AppServiceProvider, CryptographyContract is now bound to CryptographyString class, allowing the container to automatically resolve the dependencies wherever the interface is type hinted.
		
			
				
	
	
		
			10 lines
		
	
	
		
			204 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			204 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php declare(strict_types=1);
 | 
						|
 | 
						|
namespace App\Contracts;
 | 
						|
 | 
						|
interface CryptographyContract
 | 
						|
{
 | 
						|
    public function encrypt(string $text): string;
 | 
						|
    public function decrypt(string $encryptedText): string;
 | 
						|
}
 |