1. Go to this page and download the library: Download vaened/laravception 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/ */
vaened / laravception example snippets
final class InvalidCreditCardException extends RuntimeException implements TranslatableException
{
// this is enough
}
[
"invalid_credit_card_exception" => "La tarjeta de credito ingresada no es válida".
]
[
"payments" => [
"invalid_credit_card" => "La tarjeta de crédito ingresada no es válida".
]
]
[
"payments" => [
"invalid_credit_card" => "La tarjeta de crédito <:card_number> no es válida".
]
]
final class InvalidCreditCardException extends RuntimeException
implements TranslatableException, Codeable, Parametrizable
{
public function __construct(private readonly string $cardNumber)
{
parent::__construct("The credit card number <$cardNumber> is invalid");
}
public function errorCode(): string
{
return 'payments.invalid_credit_card';
}
public function parameters(): array
{
return [
'card_number' => $this->cardNumber,
];
}
}