diff --git a/app/Classes/General/Abstracts/AbstractControllerLogic.php b/app/Classes/General/Abstracts/AbstractControllerLogic.php index 84f62ebb..2fdd0dab 100644 --- a/app/Classes/General/Abstracts/AbstractControllerLogic.php +++ b/app/Classes/General/Abstracts/AbstractControllerLogic.php @@ -3,14 +3,17 @@ namespace App\Classes\General\Abstracts; +use App\Classes\Exceptions\ErrorException; +use App\Classes\Exceptions\InternalServerErrorException; use App\Classes\ValueObjects\Constants\Notifications; use App\Classes\ValueObjects\Constants\HttpStatus; use App\Classes\ValueObjects\Response\ApiResponseObject; -use ErrorException; +use ErrorException as GeneralExceptions; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Http\Resources\Json\ResourceCollection; +use Illuminate\Support\Facades\DB; abstract class AbstractControllerLogic { @@ -49,10 +52,17 @@ abstract class AbstractControllerLogic try { - return $this->logic($request); + DB::beginTransaction(); - } catch (ErrorException $exception){ - return (new ApiResponseObject($this->getNotificationTitle().' failed', $exception->getMessage(), $exception->getCode() === 0 ? 500 : $exception->getCode()))->handler(); + $response = $this->logic($request); + + DB::commit(); + + return $response; + + } catch (ErrorException|GeneralExceptions $exception){ + return (new ApiResponseObject($this->getNotificationTitle().' failed', $exception->getMessage(), + $exception->getCode() ? $exception->getCode() : HttpStatus::SERVER_ERROR))->handler(); } } diff --git a/app/Classes/General/Interfaces/DataTransferObject.php b/app/Classes/General/Interfaces/DataTransferObject.php new file mode 100644 index 00000000..8373e1db --- /dev/null +++ b/app/Classes/General/Interfaces/DataTransferObject.php @@ -0,0 +1,9 @@ +sendUserVerificationEmail::dispatch($user, $attempt); - $request->request->set('name', $request->input('type') === 2 ? $request->input('company_name') : $request->input('name')); + $request->request->set('name', $request->input('type') === 1 ? $request->input('company_name') : $request->input('name')); /** @var Company $company */ $company = $this->createCompanyProcessor->execute($request); diff --git a/app/Classes/Modules/Companies/ControllersLogic/ApproveIdentificationDocumentLogic.php b/app/Classes/Modules/Companies/ControllersLogic/ApproveIdentificationDocumentLogic.php new file mode 100644 index 00000000..ab241c70 --- /dev/null +++ b/app/Classes/Modules/Companies/ControllersLogic/ApproveIdentificationDocumentLogic.php @@ -0,0 +1,91 @@ + 'Approve Document', + 'message' => 'You have successfully approved the Document' + ]; + } + + /** @var CanApproveDocument*/ + private $canApproveDocument; + + /** @var ApprovesDocument */ + private $approvesDocument; + + /** @var RejectsDocument */ + private $rejectsDocument; + + /** @var FetchesDocument */ + private $fetchesDocument; + + /** @var UpdatesCompanyStatus */ + private $updatesCompanyStatus; + + /** + * ApproveIdentificationDocumentLogic constructor. + * @param CanApproveDocument $canApproveDocument + * @param ApprovesDocument $approvesDocument + * @param RejectsDocument $rejectsDocument + * @param FetchesDocument $fetchesDocument + * @param UpdatesCompanyStatus $updatesCompanyStatus + */ + public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus) + { + $this->canApproveDocument = $canApproveDocument; + $this->approvesDocument = $approvesDocument; + $this->rejectsDocument = $rejectsDocument; + $this->fetchesDocument = $fetchesDocument; + $this->updatesCompanyStatus = $updatesCompanyStatus; + } + + /** + * @param Request $request + * @return JsonResponse + * @throws \App\Classes\Exceptions\AccessForbiddenException + * @throws \App\Classes\Exceptions\MalformedRequestException + * @throws \App\Classes\Exceptions\RequestValidationException + */ + public function logic(Request $request) : JsonResponse + { + + $status = $request->route('status'); + + /** @var Document $document */ + $document = $this->fetchesDocument->execute(['id' => $request->route('document_id')]); + + $this->canApproveDocument->passes(); + + $document = $status === 'approve' ? $this->approvesDocument->execute($document) : $this->rejectsDocument->execute($document); + + $this->updatesCompanyStatus->execute($document->owner, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::PENDING_SUBMISSION); + + return $this->resourceResponse(new DocumentResource($document)); + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyIdentificationDocumentLogic.php b/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyIdentificationDocumentLogic.php index fdb01595..9f8afd3d 100644 --- a/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyIdentificationDocumentLogic.php +++ b/app/Classes/Modules/Companies/ControllersLogic/UpdateCompanyIdentificationDocumentLogic.php @@ -17,6 +17,7 @@ use App\Classes\ValueObjects\Constants\DocumentType; use App\Classes\ValueObjects\Constants\OwnerType; use App\Http\Resources\CompanyResource; use App\Http\Resources\DocumentResource; +use App\Models\Company; use App\Models\Document; use ErrorException; use Illuminate\Http\JsonResponse; @@ -70,31 +71,22 @@ class UpdateCompanyIdentificationDocumentLogic extends AbstractControllerLogic /** * @param Request $request * @return JsonResponse - * @throws ErrorException + * @throws \App\Classes\Exceptions\MalformedRequestException */ public function logic(Request $request) : JsonResponse { - try { + /** @var Company $company */ + $company = $this->fetchesCompany->execute(['id' => $request->route('id')]); + $object = new DocumentObject($company->type === CompanyTypes::COMPANY_BUSINESS ? DocumentType::SSM_REGISTRATION: DocumentType::IDENTITY_CARD, $request->input('files'), + $request->input('reference'), ApprovalStatus::PENDING_VERIFICATION, 'identifications'); - $company = $this->fetchesCompany->execute(['id' => $request->route('id')]); + /** @var Document $document */ + $document = $this->createsDocument->execute($company, $object); + $this->createsFile->execute($document, $object); - $object = new DocumentObject( - $company->type === CompanyTypes::COMPANY_BUSINESS ? DocumentType::SSM_REGISTRATION: DocumentType::IDENTITY_CARD, - $request->input('files'), $request->input('reference')); - - /** @var Document $document */ - $document = $this->createsDocument->execute($company, $object); - - $this->createsFile->execute($document, $object); - - $this->updatesCompanyStatus->execute($company, ApprovalStatus::PENDING_VERIFICATION); - - return $this->resourceResponse(new DocumentResource($document)); - - } catch (\Exception $exception){ - throw new ErrorException($exception->getMessage(), $exception->getCode()); - } + $this->updatesCompanyStatus->execute($company, ApprovalStatus::PENDING_VERIFICATION); + return $this->response([]); } } \ No newline at end of file diff --git a/app/Classes/Modules/Documents/ControllersLogic/RejectDocumentLogic.php b/app/Classes/Modules/Documents/ControllersLogic/RejectDocumentLogic.php new file mode 100644 index 00000000..c8f0cf8c --- /dev/null +++ b/app/Classes/Modules/Documents/ControllersLogic/RejectDocumentLogic.php @@ -0,0 +1,71 @@ + 'Reject Document', + 'message' => 'You have successfully rejected the Document' + ]; + } + + /** @var CanApproveDocument*/ + private $canApproveDocument; + + /** @var RejectsDocument */ + private $rejectsDocument; + + /** @var FetchesDocument */ + private $fetchesDocument; + + /** + * RejectDocumentLogic constructor. + * @param CanApproveDocument $canApproveDocument + * @param RejectsDocument $rejectsDocument + * @param FetchesDocument $fetchesDocument + */ + public function __construct(CanApproveDocument $canApproveDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument) + { + $this->canApproveDocument = $canApproveDocument; + $this->rejectsDocument = $rejectsDocument; + $this->fetchesDocument = $fetchesDocument; + } + + /** + * @param Request $request + * @return JsonResponse + * @throws \App\Classes\Exceptions\AccessForbiddenException + * @throws \App\Classes\Exceptions\MalformedRequestException + * @throws \App\Classes\Exceptions\RequestValidationException + */ + public function logic(Request $request) : JsonResponse + { + + $document = $this->fetchesDocument->execute(['id' => $request->route('id')]); + + $this->canApproveDocument->passes(); + + $document_query = $this->rejectsDocument->execute($document); + + return $this->resourceResponse(new DocumentResource($document_query)); + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Documents/ControllersLogic/RenderDocumentLogic.php b/app/Classes/Modules/Documents/ControllersLogic/RenderDocumentLogic.php new file mode 100644 index 00000000..54c6de12 --- /dev/null +++ b/app/Classes/Modules/Documents/ControllersLogic/RenderDocumentLogic.php @@ -0,0 +1,60 @@ +canRenderDocument = $canRenderDocument; + } + + protected function notification(): array { + return [ + 'title' => '', + 'message' => '' + ]; + } + + /** @var CanRenderDocument */ + private $canRenderDocument; + + + + /** + * @param Request $request + * @return JsonResponse + * @throws AccessForbiddenException + * @throws RequestValidationException + * @throws ResourceNotFoundException + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + */ + public function logic(Request $request) : JsonResponse + { + $file = $request->route('fileName'); + + $this->canRenderDocument->passes(); + + if(!Storage::disk('documents')->exists($file)) + { + throw new ResourceNotFoundException('Requested File not found'); + } + + return $this->response(['src' => explode('.', $file)[1] == 'pdf' ? chunk_split(base64_encode(Storage::disk('documents')->get($file))) : Storage::disk('documents')->get($file) ]); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Documents/DataTransferObjects/DocumentObject.php b/app/Classes/Modules/Documents/DataTransferObjects/DocumentObject.php index 256477ce..8f73dc1b 100644 --- a/app/Classes/Modules/Documents/DataTransferObjects/DocumentObject.php +++ b/app/Classes/Modules/Documents/DataTransferObjects/DocumentObject.php @@ -2,7 +2,7 @@ namespace App\Classes\Modules\Documents\DataTransferObjects; -use App\Classes\Interfaces\DataTransferObject; +use App\Classes\General\Interfaces\DataTransferObject; use App\Classes\Modules\Documents\Services\ConvertsBase64ToFile; class DocumentObject implements DataTransferObject @@ -14,20 +14,30 @@ class DocumentObject implements DataTransferObject /** @var array */ private $files; - /** @var string|null */ + /** @var string */ private $reference; + /** @var int */ + private $status; + + /** @var string|null */ + private $path; + /** * DocumentObject constructor. * @param string $document_type * @param array $files - * @param null|string $reference + * @param string $reference + * @param int $status + * @param null|string $path */ - public function __construct(string $document_type, array $files, ?string $reference = null) + public function __construct(string $document_type, array $files, string $reference, int $status, ?string $path = '') { $this->document_type = $document_type; $this->files = $files; $this->reference = $reference; + $this->status = $status; + $this->path = $path; } @@ -40,20 +50,29 @@ class DocumentObject implements DataTransferObject } /** - * @return string|null + * @return string */ public function getReference(): string { return $this->reference; } + /** + * @return int + */ + public function getStatus(): int + { + return $this->status; + } + + /** * @return array * @throws \App\Classes\Exceptions\MalformedRequestException */ public function getFiles(): array { - return (new ConvertsBase64ToFile())->convert($this->files); + return (new ConvertsBase64ToFile($this->path))->convert($this->files); } diff --git a/app/Classes/Modules/Documents/Services/ApprovesDocument.php b/app/Classes/Modules/Documents/Services/ApprovesDocument.php index 3bf39971..31fa1b3d 100644 --- a/app/Classes/Modules/Documents/Services/ApprovesDocument.php +++ b/app/Classes/Modules/Documents/Services/ApprovesDocument.php @@ -3,7 +3,6 @@ namespace App\Classes\Modules\Documents\Services; use App\Classes\General\Eloquent\AbstractUpdateRecord; -use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject; use App\Classes\ValueObjects\Constants\ApprovalStatus; use App\Models\Document; use Carbon\Carbon; @@ -18,7 +17,7 @@ class ApprovesDocument extends AbstractUpdateRecord */ public function execute(Document $model) { - $model->status = ApprovalStatus::ACTIVE; + $model->status = ApprovalStatus::APPROVED; $model->approved_by = Auth()->user()->id; $model->approved_date = Carbon::now(); diff --git a/app/Classes/Modules/Documents/Services/ConvertsBase64ToFile.php b/app/Classes/Modules/Documents/Services/ConvertsBase64ToFile.php index 88e078d6..119bb935 100644 --- a/app/Classes/Modules/Documents/Services/ConvertsBase64ToFile.php +++ b/app/Classes/Modules/Documents/Services/ConvertsBase64ToFile.php @@ -24,9 +24,6 @@ class ConvertsBase64ToFile { $this->path = $path; $this->filesInfo = []; - - File::isDirectory(storage_path($this->path)) or - File::makeDirectory(storage_path($this->path), 0777, true, true); } @@ -101,10 +98,9 @@ class ConvertsBase64ToFile * @throws MalformedRequestException */ private function generateFile(FileObject $file, string $suffix = '') { + $filePath = $this->path.'/'.$file->getFileName().$suffix.'.'.$file->getExtension(); - $filePath = storage_path($this->path.'/'.$file->getFileName().$suffix.'.'.$file->getExtension()); - - Storage::put($filePath, $file->getDecodedData()); + Storage::disk('documents')->put($filePath, $file->getDecodedData()); return $filePath; diff --git a/app/Classes/Modules/Documents/Services/RejectsDocument.php b/app/Classes/Modules/Documents/Services/RejectsDocument.php new file mode 100644 index 00000000..a3661959 --- /dev/null +++ b/app/Classes/Modules/Documents/Services/RejectsDocument.php @@ -0,0 +1,26 @@ +status = ApprovalStatus::REJECTED; + $model->approved_by = Auth()->user()->id; + $model->approved_date = Carbon::now(); + + return $this->handler($model); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Documents/Standards/Rules/CanApproveDocument.php b/app/Classes/Modules/Documents/Standards/Rules/CanApproveDocument.php new file mode 100644 index 00000000..544b605c --- /dev/null +++ b/app/Classes/Modules/Documents/Standards/Rules/CanApproveDocument.php @@ -0,0 +1,39 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Documents/ApproveDocumentController.php b/app/Http/Controllers/Documents/ApproveDocumentController.php new file mode 100644 index 00000000..28ab3037 --- /dev/null +++ b/app/Http/Controllers/Documents/ApproveDocumentController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Documents/ListDocumentsController.php b/app/Http/Controllers/Documents/ListDocumentsController.php new file mode 100644 index 00000000..a440737d --- /dev/null +++ b/app/Http/Controllers/Documents/ListDocumentsController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Documents/RejectDocumentController.php b/app/Http/Controllers/Documents/RejectDocumentController.php new file mode 100644 index 00000000..156d7d03 --- /dev/null +++ b/app/Http/Controllers/Documents/RejectDocumentController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Documents/RenderDocumentController.php b/app/Http/Controllers/Documents/RenderDocumentController.php new file mode 100644 index 00000000..690f99f9 --- /dev/null +++ b/app/Http/Controllers/Documents/RenderDocumentController.php @@ -0,0 +1,22 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Orders/OrderController.php b/app/Http/Controllers/Orders/OrderController.php index ee6329bb..06387eac 100644 --- a/app/Http/Controllers/Orders/OrderController.php +++ b/app/Http/Controllers/Orders/OrderController.php @@ -77,9 +77,9 @@ class OrderController 'marking' => CompanyConnections::where('module_one', $order->importer->modules->first()->id)->first()->marking ]; - return view('pages.pdf.qr', $data); +// return view('pages.pdf.qr', $data); - return $pdf->loadView('pages.pdf.qr', $data)->download(); + return $pdf->loadView('pages.pdf.qr', $data)->stream(); } } \ No newline at end of file diff --git a/app/Http/Resources/CompanyResource.php b/app/Http/Resources/CompanyResource.php index 767a7b39..211b131e 100644 --- a/app/Http/Resources/CompanyResource.php +++ b/app/Http/Resources/CompanyResource.php @@ -4,6 +4,7 @@ namespace App\Http\Resources; use App\Classes\ValueObjects\Constants\AccountStatus; use App\Classes\ValueObjects\Constants\ApprovalStatus; +use App\Classes\ValueObjects\Constants\DocumentType; use App\Models\CompanyConnections; use Illuminate\Http\Resources\Json\JsonResource; @@ -26,7 +27,8 @@ class CompanyResource extends JsonResource 'status' => (int) $this->status, 'delivery_address' => new AddressResource($this->deliveryAddress), 'contact' => new ContactResource($this->contacts->first()), - 'total_orders' => count($this->orders) + 'total_orders' => count($this->orders), + 'identification' => new DocumentResource($this->whenLoaded('documents', $this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->first())), ]; } } diff --git a/config/app.php b/config/app.php index 8409e00e..5e96e568 100644 --- a/config/app.php +++ b/config/app.php @@ -175,6 +175,8 @@ return [ App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, + Barryvdh\DomPDF\ServiceProvider::class, + ], /* @@ -226,6 +228,7 @@ return [ 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, + 'PDF' => Barryvdh\DomPDF\Facade::class, ], diff --git a/config/filesystems.php b/config/filesystems.php index 94c81126..3094b721 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -55,6 +55,13 @@ return [ 'visibility' => 'public', ], + 'documents' => [ + 'driver' => 'local', + 'root' => storage_path('app/documents'), + 'url' => env('APP_URL').'/storage', + 'visibility' => 'private', + ], + 's3' => [ 'driver' => 's3', 'key' => env('AWS_ACCESS_KEY_ID'), diff --git a/config/jwt.php b/config/jwt.php new file mode 100644 index 00000000..e1af3ccc --- /dev/null +++ b/config/jwt.php @@ -0,0 +1,302 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + + /* + |-------------------------------------------------------------------------- + | JWT Authentication Secret + |-------------------------------------------------------------------------- + | + | Don't forget to set this in your .env file, as it will be used to sign + | your tokens. A helper command is provided for this: + | `php artisan jwt:secret` + | + | Note: This will be used for Symmetric algorithms only (HMAC), + | since RSA and ECDSA use a private/public key combo (See below). + | + */ + + 'secret' => env('JWT_SECRET'), + + /* + |-------------------------------------------------------------------------- + | JWT Authentication Keys + |-------------------------------------------------------------------------- + | + | The algorithm you are using, will determine whether your tokens are + | signed with a random string (defined in `JWT_SECRET`) or using the + | following public & private keys. + | + | Symmetric Algorithms: + | HS256, HS384 & HS512 will use `JWT_SECRET`. + | + | Asymmetric Algorithms: + | RS256, RS384 & RS512 / ES256, ES384 & ES512 will use the keys below. + | + */ + + 'keys' => [ + + /* + |-------------------------------------------------------------------------- + | Public Key + |-------------------------------------------------------------------------- + | + | A path or resource to your public key. + | + | E.g. 'file://path/to/public/key' + | + */ + + 'public' => env('JWT_PUBLIC_KEY'), + + /* + |-------------------------------------------------------------------------- + | Private Key + |-------------------------------------------------------------------------- + | + | A path or resource to your private key. + | + | E.g. 'file://path/to/private/key' + | + */ + + 'private' => env('JWT_PRIVATE_KEY'), + + /* + |-------------------------------------------------------------------------- + | Passphrase + |-------------------------------------------------------------------------- + | + | The passphrase for your private key. Can be null if none set. + | + */ + + 'passphrase' => env('JWT_PASSPHRASE'), + + ], + + /* + |-------------------------------------------------------------------------- + | JWT time to live + |-------------------------------------------------------------------------- + | + | Specify the length of time (in minutes) that the token will be valid for. + | Defaults to 1 hour. + | + | You can also set this to null, to yield a never expiring token. + | Some people may want this behaviour for e.g. a mobile app. + | This is not particularly recommended, so make sure you have appropriate + | systems in place to revoke the token if necessary. + | Notice: If you set this to null you should remove 'exp' element from 'required_claims' list. + | + */ + + 'ttl' => env('JWT_TTL', 60), + + /* + |-------------------------------------------------------------------------- + | Refresh time to live + |-------------------------------------------------------------------------- + | + | Specify the length of time (in minutes) that the token can be refreshed + | within. I.E. The user can refresh their token within a 2 week window of + | the original token being created until they must re-authenticate. + | Defaults to 2 weeks. + | + | You can also set this to null, to yield an infinite refresh time. + | Some may want this instead of never expiring tokens for e.g. a mobile app. + | This is not particularly recommended, so make sure you have appropriate + | systems in place to revoke the token if necessary. + | + */ + + 'refresh_ttl' => env('JWT_REFRESH_TTL', 20160), + + /* + |-------------------------------------------------------------------------- + | JWT hashing algorithm + |-------------------------------------------------------------------------- + | + | Specify the hashing algorithm that will be used to sign the token. + | + | See here: https://github.com/namshi/jose/tree/master/src/Namshi/JOSE/Signer/OpenSSL + | for possible values. + | + */ + + 'algo' => env('JWT_ALGO', 'HS256'), + + /* + |-------------------------------------------------------------------------- + | Required Claims + |-------------------------------------------------------------------------- + | + | Specify the required claims that must exist in any token. + | A TokenInvalidException will be thrown if any of these claims are not + | present in the payload. + | + */ + + 'required_claims' => [ + 'iss', + 'iat', + 'exp', + 'nbf', + 'sub', + 'jti', + ], + + /* + |-------------------------------------------------------------------------- + | Persistent Claims + |-------------------------------------------------------------------------- + | + | Specify the claim keys to be persisted when refreshing a token. + | `sub` and `iat` will automatically be persisted, in + | addition to the these claims. + | + | Note: If a claim does not exist then it will be ignored. + | + */ + + 'persistent_claims' => [ + 'name', 'email', 'type', 'company_id', 'status', 'verification'], + + /* + |-------------------------------------------------------------------------- + | Lock Subject + |-------------------------------------------------------------------------- + | + | This will determine whether a `prv` claim is automatically added to + | the token. The purpose of this is to ensure that if you have multiple + | authentication models e.g. `App\User` & `App\OtherPerson`, then we + | should prevent one authentication request from impersonating another, + | if 2 tokens happen to have the same id across the 2 different models. + | + | Under specific circumstances, you may want to disable this behaviour + | e.g. if you only have one authentication model, then you would save + | a little on token size. + | + */ + + 'lock_subject' => true, + + /* + |-------------------------------------------------------------------------- + | Leeway + |-------------------------------------------------------------------------- + | + | This property gives the jwt timestamp claims some "leeway". + | Meaning that if you have any unavoidable slight clock skew on + | any of your servers then this will afford you some level of cushioning. + | + | This applies to the claims `iat`, `nbf` and `exp`. + | + | Specify in seconds - only if you know you need it. + | + */ + + 'leeway' => env('JWT_LEEWAY', 0), + + /* + |-------------------------------------------------------------------------- + | Blacklist Enabled + |-------------------------------------------------------------------------- + | + | In order to invalidate tokens, you must have the blacklist enabled. + | If you do not want or need this functionality, then set this to false. + | + */ + + 'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true), + + /* + | ------------------------------------------------------------------------- + | Blacklist Grace Period + | ------------------------------------------------------------------------- + | + | When multiple concurrent requests are made with the same JWT, + | it is possible that some of them fail, due to token regeneration + | on every request. + | + | Set grace period in seconds to prevent parallel request failure. + | + */ + + 'blacklist_grace_period' => env('JWT_BLACKLIST_GRACE_PERIOD', 0), + + /* + |-------------------------------------------------------------------------- + | Cookies encryption + |-------------------------------------------------------------------------- + | + | By default Laravel encrypt cookies for security reason. + | If you decide to not decrypt cookies, you will have to configure Laravel + | to not encrypt your cookie token by adding its name into the $except + | array available in the middleware "EncryptCookies" provided by Laravel. + | see https://laravel.com/docs/master/responses#cookies-and-encryption + | for details. + | + | Set it to true if you want to decrypt cookies. + | + */ + + 'decrypt_cookies' => false, + + /* + |-------------------------------------------------------------------------- + | Providers + |-------------------------------------------------------------------------- + | + | Specify the various providers used throughout the package. + | + */ + + 'providers' => [ + + /* + |-------------------------------------------------------------------------- + | JWT Provider + |-------------------------------------------------------------------------- + | + | Specify the provider that is used to create and decode the tokens. + | + */ + + 'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class, + + /* + |-------------------------------------------------------------------------- + | Authentication Provider + |-------------------------------------------------------------------------- + | + | Specify the provider that is used to authenticate users. + | + */ + + 'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class, + + /* + |-------------------------------------------------------------------------- + | Storage Provider + |-------------------------------------------------------------------------- + | + | Specify the provider that is used to store tokens in the blacklist. + | + */ + + 'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class, + + ], + +]; diff --git a/load_font.php b/load_font.php index 066abfe7..d8ca4691 100644 --- a/load_font.php +++ b/load_font.php @@ -7,7 +7,7 @@ require_once "vendor/autoload.php"; // If you have modified your font directory set this // variable appropriately. //$fontDir = "lib/fonts"; - +$fontDir = 'storage/fonts'; // *** DO NOT MODIFY BELOW THIS POINT *** diff --git a/resources/assets/images/2829248.png b/resources/assets/images/2829248.png new file mode 100644 index 00000000..50a0280f Binary files /dev/null and b/resources/assets/images/2829248.png differ diff --git a/resources/assets/images/2853457.png b/resources/assets/images/2853457.png new file mode 100644 index 00000000..b9107cf8 Binary files /dev/null and b/resources/assets/images/2853457.png differ diff --git a/resources/assets/images/2942005.jpg b/resources/assets/images/2942005.jpg new file mode 100644 index 00000000..83908287 Binary files /dev/null and b/resources/assets/images/2942005.jpg differ diff --git a/resources/assets/images/3231370.jpg b/resources/assets/images/3231370.jpg new file mode 100644 index 00000000..41002f1b Binary files /dev/null and b/resources/assets/images/3231370.jpg differ diff --git a/resources/assets/images/3568950.png b/resources/assets/images/3568950.png new file mode 100644 index 00000000..9003367b Binary files /dev/null and b/resources/assets/images/3568950.png differ diff --git a/resources/assets/images/wechat_insturction.png b/resources/assets/images/wechat_insturction.png new file mode 100644 index 00000000..1b793a52 Binary files /dev/null and b/resources/assets/images/wechat_insturction.png differ diff --git a/resources/assets/vue/components/address/forms/AddressFormComponent.vue b/resources/assets/vue/components/address/forms/AddressFormComponent.vue index db61ff26..46607f84 100644 --- a/resources/assets/vue/components/address/forms/AddressFormComponent.vue +++ b/resources/assets/vue/components/address/forms/AddressFormComponent.vue @@ -1,5 +1,5 @@