large commit

This commit is contained in:
Omair Saleh
2019-06-03 22:48:42 +08:00
parent 2aa9ddedde
commit 352b171d5c
4 changed files with 22 additions and 4 deletions
@@ -6,7 +6,6 @@ use App\Classes\Modules\Accounts\DataTransferObjects\UserInvitationObject;
use App\Classes\Modules\Accounts\Services\CreatesUserInvitation;
use App\Classes\Modules\Accounts\Validation\CanSendAccountInvitation;
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
use App\Classes\Modules\ControllerLogic\Exceptions\ResourceConflictException;
use App\Classes\ValueObjects\Constants\HttpStatus;
use App\Events\Accounts\UserInvited;
use Illuminate\Http\JsonResponse;
@@ -52,7 +51,7 @@ class CreateAccountInvitationLogic
return new JsonResponse("Invitation have been sent!", HttpStatus::RESOURCE_CREATED);
}
} catch (ResourceConflictException $exception) {
} catch (\Exception $exception) {
throw new InternalServerErrorException("Failed to send user invitation because {$exception->getMessage()}");
}
}
+9 -2
View File
@@ -3,15 +3,22 @@
namespace App\Classes;
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
final class common
{
/**
* @param int $length
* @return string
* @throws \Exception
* @throws InternalServerErrorException
*/
public static function generateRandomHash(int $length = 10): string {
return substr(bin2hex(random_bytes(ceil($length / 2))), 0, $length);
try {
return substr(bin2hex(random_bytes(ceil($length / 2))), 0, $length);
} catch (\Exception $exception){
throw new InternalServerErrorException('Failed to generate hash for user invitation');
}
}
}
+11
View File
@@ -24,6 +24,17 @@
position: relative;
float:right;
}
.login-triangle {
display: inline-block;
position: absolute;
right: 0; top: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 0 0 100vh 14rem;
border-color: transparent transparent #fff;
z-index: 10;
}
.bg-caption{
width: 500px;
}
@@ -5,6 +5,7 @@
<div class="row no-margin" style=" min-height: 100%; ">
<div class="col no-padding" style="background-image: url({{asset('images/shipping_bg.jpeg')}}); background-position: center; background-size: cover;">
<div class="w-100 h-100 bg-primary" style="position: absolute; opacity: 0.1;"></div>
<span class="login-triangle"></span>
</div>
<div class="col-4 padding-50 bg-white">
<div class="row m-t-50">