This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Organizations: | |
- &OrdererOrg | |
Name: OrdererOrg | |
ID: OrdererMSP | |
MSPDir: ../crypto-config/ordererOrganizations/orderer-org/msp | |
- &ShopOrg | |
Name: ShopOrgMSP | |
ID: ShopOrgMSP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB::beginTransaction(); | |
try{ | |
https://stackoverflow.com/questions/53749422/where-to-put-insertion-and-get-query-logic-in-a-service-layer-or-model | |
$translated_id = $this->recordTranslation($request->values); | |
$column_mapping = new TransportTypeColumnMapping(); | |
$column_mapping->transport_type_id = $request->transport_type_id; | |
$column_mapping->transport_type_column_id = $request->transport_type_column_id; | |
$column_mapping->value = $translated_id; | |
if(!$column_mapping->save()) throw new \Exception(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB::beginTransaction(); | |
try{ | |
$user = new User(); | |
$user->save(); | |
DB::commit(); | |
} | |
catch(\Exception $e){ | |
DB::rollback(); | |
return response()->json(['message'=>'error']); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Services; | |
use Tymon\JWTAuth\Facades\JWTAuth; | |
use App\Http\Models\Users\User; | |
use App\Http\Models\Users\TokenUser; | |
use App\Http\Services\NotificationService; | |
use App\Http\Models\Users\EmailConfirmation; | |
use App\Http\Models\Users\PasswordResetConfirmation; | |
use Carbon\Carbon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$confirmation_code = str_random(6); | |
DB::beginTransaction(); | |
try{ | |
$this->emailconfirmation->create([ | |
'code' => $confirmation_code, | |
'email' => $request->email, | |
'expires_at' => Carbon::now()->addHour() | |
]); | |
$this->user->saveUser($request); | |
$this->user->assignRole($request->role_name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Http\Requests\AuthRequests\UserLoginRequest; | |
use App\Http\Requests\AuthRequests\UserRegisterRequest; | |
use App\Http\Requests\AuthRequests\ResendNotificationRequest; | |
use App\Http\Requests\AuthRequests\ConfirmRegistrationRequest; | |
use App\Http\Requests\AuthRequests\SendResetPasswordCodeRequest; | |
use App\Http\Requests\AuthRequests\ResetPasswordRequest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Models\Transport_Type; | |
use Illuminate\Database\Eloquent\Model; | |
// use App\Http\Models\Transport_Type\TransportType; | |
use App\Http\Traits\ScopeTrait; | |
class TransportType extends Model{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (this.refreshTokenInProgress) { | |
return this.refreshTokenSubject | |
.filter(tokens => tokens !== null) | |
.pipe( | |
take(1), | |
switchMap((tokens) => { | |
return next.handle(this.addToken(tokens, request)).pipe( | |
tap( | |
evt =>{ | |
if(evt instanceof HttpResponse) this.loaderService.storeLoaderOff(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AuthService } from './../auth.service'; | |
import { HttpClient, HttpHeaders, HttpResponse, HttpErrorResponse } from '@angular/common/http'; | |
// src/app/services/token-interceptor.service.ts | |
import { Injectable } from "@angular/core"; | |
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from "@angular/common/http"; | |
import { Observable } from "rxjs/Observable"; | |
import { BehaviorSubject } from "rxjs/BehaviorSubject"; | |
import { Storage } from "@ionic/storage" | |
import { from, of, throwError } from "rxjs"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function findTransport($id){ | |
try{ | |
$transport = Transport::find($id); | |
}catch(\Exception $e){ | |
} | |
} |