Compare commits
20 Commits
feature/Cr
...
feature/Ga
| Author | SHA1 | Date | |
|---|---|---|---|
| a7fa1097b7 | |||
| f2f9d38907 | |||
| 5b79cefe28 | |||
| 41b7ead69e | |||
| 5ea986db40 | |||
| f3a9b5e788 | |||
| d04277ece5 | |||
| e53a89016f | |||
| 53f2303253 | |||
| c6dc5256e6 | |||
| 19abb28acf | |||
| 431acd9279 | |||
| 9fcd8045db | |||
| 7c82556d93 | |||
| 581e7af1fd | |||
| b433d2ff52 | |||
| 6f06218cb2 | |||
| 1a2077a164 | |||
| 363c7005d0 | |||
| f29510d76e |
0
backend/.dockerignore
Normal file → Executable file
0
backend/.dockerignore
Normal file → Executable file
0
backend/.editorconfig
Normal file → Executable file
0
backend/.editorconfig
Normal file → Executable file
0
backend/.env.example
Normal file → Executable file
0
backend/.env.example
Normal file → Executable file
0
backend/.gitattributes
vendored
Normal file → Executable file
0
backend/.gitattributes
vendored
Normal file → Executable file
0
backend/.gitignore
vendored
Normal file → Executable file
0
backend/.gitignore
vendored
Normal file → Executable file
0
backend/.npmrc
Normal file → Executable file
0
backend/.npmrc
Normal file → Executable file
0
backend/Dockerfile
Normal file → Executable file
0
backend/Dockerfile
Normal file → Executable file
0
backend/Dockerfile.production
Normal file → Executable file
0
backend/Dockerfile.production
Normal file → Executable file
0
backend/README.md
Normal file → Executable file
0
backend/README.md
Normal file → Executable file
24
backend/app/Admin/Controllers/AuthController.php
Normal file → Executable file
24
backend/app/Admin/Controllers/AuthController.php
Normal file → Executable file
@@ -2,26 +2,34 @@
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Requests\Auth\LoginRequest;
|
||||
use App\Admin\Requests\Auth\RegisterRequest;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Expert;
|
||||
use App\Traits\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class AuthController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function register(Request $request): JsonResponse
|
||||
public function register(RegisterRequest $request): JsonResponse
|
||||
{
|
||||
// Expert::query()->create();
|
||||
Expert::query()->create([
|
||||
'username' => $request->username,
|
||||
'email' => $request->email,
|
||||
'password' => Hash::make($request->password),
|
||||
]);
|
||||
|
||||
$request->session()->regenerate();
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function login(Request $request): JsonResponse
|
||||
public function login(LoginRequest $request): JsonResponse
|
||||
{
|
||||
$credentials = ['password' => $request->password];
|
||||
|
||||
@@ -35,13 +43,7 @@ class AuthController extends Controller
|
||||
{
|
||||
$request->session()->regenerate();
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
return $this->successResponse([
|
||||
'id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'email' => $user->email,
|
||||
]);
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
return $this->errorResponse(__('messages.incorrect_or_username_password'));
|
||||
@@ -49,7 +51,7 @@ class AuthController extends Controller
|
||||
|
||||
public function logout(Request $request): JsonResponse
|
||||
{
|
||||
Auth::logout();
|
||||
Auth::guard('expert')->logout();
|
||||
|
||||
$request->session()->invalidate();
|
||||
|
||||
|
||||
21
backend/app/Admin/Controllers/DocumentationController.php
Normal file → Executable file
21
backend/app/Admin/Controllers/DocumentationController.php
Normal file → Executable file
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Requests\Documentation\RejectRequest;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
@@ -16,31 +17,37 @@ class DocumentationController extends Controller
|
||||
public function index(Request $request): array
|
||||
{
|
||||
return DataTableFacade::run(
|
||||
User::query()->with('documents'),
|
||||
User::query(),
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
allowedSelects: [
|
||||
'users.id', 'users.first_name', 'users.last_name', 'users.national_id',
|
||||
'users.phone_number', 'users.postal_code', 'users.city_id', 'users.province_id',
|
||||
'users.province_name', 'users.city_name', 'users.address', 'documents.title', 'documents.url'
|
||||
'id', 'first_name', 'last_name', 'national_id',
|
||||
'phone_number', 'postal_code', 'city_id', 'province_id',
|
||||
'province_name', 'city_name', 'address'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function files(User $user): JsonResponse
|
||||
{
|
||||
return $this->successResponse($user->load('documents'));
|
||||
}
|
||||
|
||||
public function confirm(User $user): JsonResponse
|
||||
{
|
||||
$user->update([
|
||||
|
||||
'authority_level' => 1
|
||||
]);
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function reject(User $user): JsonResponse
|
||||
public function reject(RejectRequest $request, User $user): JsonResponse
|
||||
{
|
||||
$user->update([
|
||||
|
||||
'kyc_status' => 0,
|
||||
'kyc_reject_reason' => $request->kyc_reject_reason
|
||||
]);
|
||||
|
||||
return $this->successResponse();
|
||||
|
||||
4
backend/app/Admin/Controllers/ExpertManagementController.php
Normal file → Executable file
4
backend/app/Admin/Controllers/ExpertManagementController.php
Normal file → Executable file
@@ -4,7 +4,6 @@ namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Requests\ExpertManagement\StoreRequest;
|
||||
use App\Admin\Requests\ExpertManagement\UpdateRequest;
|
||||
use App\Admin\Resources\ExpertManagementResource;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\City;
|
||||
@@ -67,8 +66,7 @@ class ExpertManagementController extends Controller
|
||||
*/
|
||||
public function show(Expert $expert): JsonResponse
|
||||
{
|
||||
return $this->successResponse(
|
||||
new ExpertManagementResource($expert)
|
||||
return $this->successResponse($expert->load(['roles','permissions'])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
0
backend/app/Admin/Controllers/PermissionManagementController.php
Normal file → Executable file
0
backend/app/Admin/Controllers/PermissionManagementController.php
Normal file → Executable file
20
backend/app/Admin/Controllers/ProfileController.php
Normal file → Executable file
20
backend/app/Admin/Controllers/ProfileController.php
Normal file → Executable file
@@ -2,11 +2,13 @@
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Requests\Profile\ChangePasswordRequest;
|
||||
use App\Admin\Resources\ExpertResource;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Traits\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class ProfileController extends Controller
|
||||
{
|
||||
@@ -14,6 +16,22 @@ class ProfileController extends Controller
|
||||
|
||||
public function info(): JsonResponse
|
||||
{
|
||||
return $this->successResponse(new ExpertResource(Auth::user()));
|
||||
return $this->successResponse(new ExpertResource(Auth::guard('expert')->user()));
|
||||
}
|
||||
|
||||
public function changePassword(ChangePasswordRequest $request): JsonResponse
|
||||
{
|
||||
$expert = Auth::guard('expert')->user();
|
||||
|
||||
if (! Hash::check($request->current_password, $expert->password))
|
||||
{
|
||||
return $this->errorResponse(__('messages.incorrect_current_password'));
|
||||
}
|
||||
|
||||
$expert->update([
|
||||
'password' => Hash::make($request->new_password)
|
||||
]);
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
}
|
||||
|
||||
0
backend/app/Admin/Controllers/UserManagementController.php
Normal file → Executable file
0
backend/app/Admin/Controllers/UserManagementController.php
Normal file → Executable file
30
backend/app/Admin/Requests/Auth/LoginRequest.php
Executable file
30
backend/app/Admin/Requests/Auth/LoginRequest.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Requests\Auth;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoginRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'login' => 'required|string',
|
||||
'password' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
31
backend/app/Admin/Requests/Auth/RegisterRequest.php
Executable file
31
backend/app/Admin/Requests/Auth/RegisterRequest.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Requests\Auth;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RegisterRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'username' => 'required|unique:experts,username',
|
||||
'email' => 'required|email|unique:experts,email',
|
||||
'password' => 'required|string|regex:/^(?=.*[a-zA-Z])(?=.*\d).+$/|min:6|confirmed',
|
||||
];
|
||||
}
|
||||
}
|
||||
29
backend/app/Admin/Requests/Documentation/RejectRequest.php
Executable file
29
backend/app/Admin/Requests/Documentation/RejectRequest.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Requests\Documentation;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RejectRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kyc_reject_reason' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
0
backend/app/Admin/Requests/ExpertManagement/StoreRequest.php
Normal file → Executable file
0
backend/app/Admin/Requests/ExpertManagement/StoreRequest.php
Normal file → Executable file
0
backend/app/Admin/Requests/ExpertManagement/UpdateRequest.php
Normal file → Executable file
0
backend/app/Admin/Requests/ExpertManagement/UpdateRequest.php
Normal file → Executable file
0
backend/app/Admin/Requests/PermissionManagement/StoreRequest.php
Normal file → Executable file
0
backend/app/Admin/Requests/PermissionManagement/StoreRequest.php
Normal file → Executable file
2
backend/app/Admin/Requests/PermissionManagement/UpdateRequest.php
Normal file → Executable file
2
backend/app/Admin/Requests/PermissionManagement/UpdateRequest.php
Normal file → Executable file
@@ -27,7 +27,7 @@ class UpdateRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255', Rule::unique('permission', 'name')->ignore($this->permission->id)],
|
||||
'name' => ['required', 'string', 'max:255', Rule::unique('permissions', 'name')->ignore($this->permission->id)],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
30
backend/app/Admin/Requests/Profile/ChangePasswordRequest.php
Executable file
30
backend/app/Admin/Requests/Profile/ChangePasswordRequest.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Requests\Profile;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ChangePasswordRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'current_password' => 'required|string|regex:/^(?=.*[a-zA-Z])(?=.*\d).+$/|min:8',
|
||||
'new_password' => 'required|string|regex:/^(?=.*[a-zA-Z])(?=.*\d).+$/|min:8',
|
||||
];
|
||||
}
|
||||
}
|
||||
4
backend/app/Admin/Requests/RoleManagement/StoreRequest.php
Normal file → Executable file
4
backend/app/Admin/Requests/RoleManagement/StoreRequest.php
Normal file → Executable file
@@ -24,8 +24,8 @@ class StoreRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|unique:roles,name',
|
||||
'permissions' => 'required|array',
|
||||
'permissions.*.name' => 'required|string|exists:permissions,name',
|
||||
'permissions' => 'array',
|
||||
'permissions.*' => 'integer|exists:permissions,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
6
backend/app/Admin/Requests/RoleManagement/UpdateRequest.php
Normal file → Executable file
6
backend/app/Admin/Requests/RoleManagement/UpdateRequest.php
Normal file → Executable file
@@ -27,9 +27,9 @@ class UpdateRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255', Rule::unique('roles', 'name')->ignore($this->role->id)],
|
||||
'permissions' => 'required|array',
|
||||
'permissions.*.name' => 'required|string|exists:permissions,name',
|
||||
'name' => ['string', 'max:255', Rule::unique('roles', 'name')->ignore($this->role->id)],
|
||||
'permissions' => 'array',
|
||||
'permissions.*' => 'integer|exists:permissions,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
0
backend/app/Admin/Requests/UserManagement/StoreRequest.php
Normal file → Executable file
0
backend/app/Admin/Requests/UserManagement/StoreRequest.php
Normal file → Executable file
0
backend/app/Admin/Requests/UserManagement/UpdateRequest.php
Normal file → Executable file
0
backend/app/Admin/Requests/UserManagement/UpdateRequest.php
Normal file → Executable file
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/**
|
||||
* @method roles()
|
||||
* @method getAllPermissions()
|
||||
*/
|
||||
class ExpertManagementResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'username' => $this->username,
|
||||
'first_name' => $this->first_name,
|
||||
'last_name' => $this->last_name,
|
||||
'national_id' => $this->national_id,
|
||||
'email' => $this->email,
|
||||
'phone_number' => $this->phone_number,
|
||||
'province_name' => $this->province_name,
|
||||
'city_name' => $this->city_name,
|
||||
'roles' => $this->roles()
|
||||
->pluck('name')
|
||||
->values(),
|
||||
|
||||
'permissions' => $this->getAllPermissions()
|
||||
->pluck('name')
|
||||
->values(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
0
backend/app/Admin/Resources/ExpertResource.php
Normal file → Executable file
0
backend/app/Admin/Resources/ExpertResource.php
Normal file → Executable file
66
backend/app/Enums/BusinessTypeEnum.php
Normal file
66
backend/app/Enums/BusinessTypeEnum.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum BusinessTypeEnum: int
|
||||
{
|
||||
case MEDICAL = 1;
|
||||
case LEGAL = 2;
|
||||
case ENGINEERING = 3;
|
||||
case EDUCATION = 4;
|
||||
case CONSULTING = 5;
|
||||
case BEAUTY = 6;
|
||||
case TECHNICAL_SERVICES = 7;
|
||||
case FINANCIAL = 8;
|
||||
case REAL_ESTATE = 9;
|
||||
case RESTAURANT = 10;
|
||||
case SHOP = 11;
|
||||
case TRANSPORTATION = 12;
|
||||
case ART = 13;
|
||||
case SPORT = 14;
|
||||
case OTHER = 15;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::MEDICAL => 'medical',
|
||||
self::LEGAL => 'legal',
|
||||
self::ENGINEERING => 'engineering',
|
||||
self::EDUCATION => 'education',
|
||||
self::CONSULTING => 'consulting',
|
||||
self::BEAUTY => 'beauty',
|
||||
self::TECHNICAL_SERVICES => 'technical_services',
|
||||
self::FINANCIAL => 'financial',
|
||||
self::REAL_ESTATE => 'real_estate',
|
||||
self::RESTAURANT => 'restaurant',
|
||||
self::SHOP => 'shop',
|
||||
self::TRANSPORTATION => 'transportation',
|
||||
self::ART => 'art',
|
||||
self::SPORT => 'sport',
|
||||
self::OTHER => 'other',
|
||||
};
|
||||
}
|
||||
|
||||
public function name($id): string
|
||||
{
|
||||
$mapArray = [
|
||||
1 => 'medical',
|
||||
2 => 'legal',
|
||||
3 => 'engineering',
|
||||
4 => 'education',
|
||||
5 => 'consulting',
|
||||
6 => 'beauty',
|
||||
7 => 'technical_services',
|
||||
8 => 'financial',
|
||||
9 => 'real_estate',
|
||||
10 => 'restaurant',
|
||||
11 => 'shop',
|
||||
12 => 'transportation',
|
||||
13 => 'art',
|
||||
14 => 'sport',
|
||||
15 => 'other',
|
||||
];
|
||||
|
||||
return $mapArray[$id];
|
||||
}
|
||||
}
|
||||
23
backend/app/Enums/PaymentStatusEnum.php
Normal file
23
backend/app/Enums/PaymentStatusEnum.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum PaymentStatusEnum:int
|
||||
{
|
||||
case Unpaid = 0;
|
||||
case Cancelled = 1;
|
||||
case Expired = 2;
|
||||
case Paid = 3;
|
||||
case Refunded = 4;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Unpaid => 'unpaid',
|
||||
self::Cancelled => 'cancelled',
|
||||
self::Expired => 'expired',
|
||||
self::Paid => 'paid',
|
||||
self::Refunded => 'refunded',
|
||||
};
|
||||
}
|
||||
}
|
||||
0
backend/app/Facades/DataTable/DataTable.php
Normal file → Executable file
0
backend/app/Facades/DataTable/DataTable.php
Normal file → Executable file
0
backend/app/Facades/DataTable/DataTableFacade.php
Normal file → Executable file
0
backend/app/Facades/DataTable/DataTableFacade.php
Normal file → Executable file
0
backend/app/Facades/File/File.php
Normal file → Executable file
0
backend/app/Facades/File/File.php
Normal file → Executable file
0
backend/app/Facades/File/FileFacade.php
Normal file → Executable file
0
backend/app/Facades/File/FileFacade.php
Normal file → Executable file
0
backend/app/Http/Controllers/Controller.php
Normal file → Executable file
0
backend/app/Http/Controllers/Controller.php
Normal file → Executable file
0
backend/app/Mail/LoginNotificationMail.php
Normal file → Executable file
0
backend/app/Mail/LoginNotificationMail.php
Normal file → Executable file
15
backend/app/Models/BusinessType.php
Normal file
15
backend/app/Models/BusinessType.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\BusinessTypeFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BusinessType extends Model
|
||||
{
|
||||
/** @use HasFactory<BusinessTypeFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
0
backend/app/Models/City.php
Normal file → Executable file
0
backend/app/Models/City.php
Normal file → Executable file
0
backend/app/Models/Document.php
Normal file → Executable file
0
backend/app/Models/Document.php
Normal file → Executable file
3
backend/app/Models/Expert.php
Normal file → Executable file
3
backend/app/Models/Expert.php
Normal file → Executable file
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use Database\Factories\ExpertFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
/**
|
||||
* @method roles()
|
||||
@@ -14,6 +15,8 @@ class Expert extends Model
|
||||
{
|
||||
/** @use HasFactory<ExpertFactory> */
|
||||
use HasFactory;
|
||||
use HasRoles;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected string $guard_name = 'web';
|
||||
}
|
||||
|
||||
12
backend/app/Models/FibTransaction.php
Normal file
12
backend/app/Models/FibTransaction.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FibTransaction extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\FibTransactionFactory> */
|
||||
use HasFactory;
|
||||
}
|
||||
12
backend/app/Models/FibTransactionStatus.php
Normal file
12
backend/app/Models/FibTransactionStatus.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FibTransactionStatus extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\FibTransactionStatusFactory> */
|
||||
use HasFactory;
|
||||
}
|
||||
15
backend/app/Models/Payment.php
Normal file
15
backend/app/Models/Payment.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\PaymentFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Payment extends Model
|
||||
{
|
||||
/** @use HasFactory<PaymentFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
15
backend/app/Models/PaymentStatus.php
Normal file
15
backend/app/Models/PaymentStatus.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\PaymentStatusFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PaymentStatus extends Model
|
||||
{
|
||||
/** @use HasFactory<PaymentStatusFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
0
backend/app/Models/Province.php
Normal file → Executable file
0
backend/app/Models/Province.php
Normal file → Executable file
15
backend/app/Models/Transaction.php
Normal file
15
backend/app/Models/Transaction.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\TransactionFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Transaction extends Model
|
||||
{
|
||||
/** @use HasFactory<TransactionFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
@@ -10,6 +10,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Laravel\Passport\Bridge\Client;
|
||||
use Laravel\Passport\HasApiTokens;
|
||||
|
||||
#[Guarded(['id'])]
|
||||
@@ -24,4 +26,14 @@ class User extends Authenticatable
|
||||
{
|
||||
return $this->morphToMany(Document::class, 'documentable');
|
||||
}
|
||||
|
||||
public function validateForPassportPasswordGrant(string $password): bool
|
||||
{
|
||||
return Hash::check($password, $this->password);
|
||||
}
|
||||
|
||||
public function findForPassport(string $username, Client $client): User
|
||||
{
|
||||
return $this->where('username', $username)->first();
|
||||
}
|
||||
}
|
||||
|
||||
15
backend/app/Models/UserGateway.php
Normal file
15
backend/app/Models/UserGateway.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\UserGatewayFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserGateway extends Model
|
||||
{
|
||||
/** @use HasFactory<UserGatewayFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
@@ -22,6 +22,8 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function boot(): void
|
||||
{
|
||||
Passport::enablePasswordGrant();
|
||||
Passport::tokensExpireIn(CarbonInterval::minutes(1));
|
||||
Passport::refreshTokensExpireIn(CarbonInterval::minutes(5));
|
||||
Passport::personalAccessTokensExpireIn(CarbonInterval::minutes(1));
|
||||
}
|
||||
}
|
||||
|
||||
0
backend/app/Providers/DataTableServiceProvider.php
Normal file → Executable file
0
backend/app/Providers/DataTableServiceProvider.php
Normal file → Executable file
0
backend/app/Providers/FileServiceProvider.php
Normal file → Executable file
0
backend/app/Providers/FileServiceProvider.php
Normal file → Executable file
0
backend/app/Services/DataTable/DataTableInput.php
Normal file → Executable file
0
backend/app/Services/DataTable/DataTableInput.php
Normal file → Executable file
0
backend/app/Services/DataTable/DataTableService.php
Normal file → Executable file
0
backend/app/Services/DataTable/DataTableService.php
Normal file → Executable file
0
backend/app/Services/DataTable/Enums/DataType.php
Normal file → Executable file
0
backend/app/Services/DataTable/Enums/DataType.php
Normal file → Executable file
0
backend/app/Services/DataTable/Enums/SearchType.php
Normal file → Executable file
0
backend/app/Services/DataTable/Enums/SearchType.php
Normal file → Executable file
0
backend/app/Services/DataTable/Exceptions/InvalidFilterException.php
Normal file → Executable file
0
backend/app/Services/DataTable/Exceptions/InvalidFilterException.php
Normal file → Executable file
0
backend/app/Services/DataTable/Exceptions/InvalidParameterInterface.php
Normal file → Executable file
0
backend/app/Services/DataTable/Exceptions/InvalidParameterInterface.php
Normal file → Executable file
0
backend/app/Services/DataTable/Exceptions/InvalidRelationException.php
Normal file → Executable file
0
backend/app/Services/DataTable/Exceptions/InvalidRelationException.php
Normal file → Executable file
0
backend/app/Services/DataTable/Exceptions/InvalidSortingException.php
Normal file → Executable file
0
backend/app/Services/DataTable/Exceptions/InvalidSortingException.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/ApplyFilter.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/ApplyFilter.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/Filter.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/Filter.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterBetween.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterBetween.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterContains.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterContains.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterEquals.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterEquals.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThan.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThan.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThanOrEqual.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThanOrEqual.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterLessThan.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterLessThan.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterLessThanOrEqual.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterLessThanOrEqual.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterNotEquals.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/FilterNotEquals.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/SearchFilter.php
Normal file → Executable file
0
backend/app/Services/DataTable/Filter/SearchFunctions/SearchFilter.php
Normal file → Executable file
0
backend/app/Services/DataTable/Sort/ApplySort.php
Normal file → Executable file
0
backend/app/Services/DataTable/Sort/ApplySort.php
Normal file → Executable file
0
backend/app/Services/DataTable/Sort/Sort.php
Normal file → Executable file
0
backend/app/Services/DataTable/Sort/Sort.php
Normal file → Executable file
0
backend/app/Services/DataTable/Validators/FilterValidator.php
Normal file → Executable file
0
backend/app/Services/DataTable/Validators/FilterValidator.php
Normal file → Executable file
0
backend/app/Services/DataTable/Validators/RelationValidator.php
Normal file → Executable file
0
backend/app/Services/DataTable/Validators/RelationValidator.php
Normal file → Executable file
0
backend/app/Services/DataTable/Validators/SortingValidator.php
Normal file → Executable file
0
backend/app/Services/DataTable/Validators/SortingValidator.php
Normal file → Executable file
2
backend/app/User/Services/FIB/AuthorizationService.php → backend/app/Services/FIB/AuthorizationService.php
Normal file → Executable file
2
backend/app/User/Services/FIB/AuthorizationService.php → backend/app/Services/FIB/AuthorizationService.php
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Services\FIB;
|
||||
namespace App\Services\FIB;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
2
backend/app/User/Services/FIB/CancelPaymentService.php → backend/app/Services/FIB/CancelPaymentService.php
Normal file → Executable file
2
backend/app/User/Services/FIB/CancelPaymentService.php → backend/app/Services/FIB/CancelPaymentService.php
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Services\FIB;
|
||||
namespace App\Services\FIB;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
2
backend/app/User/Services/FIB/CheckPaymentStatusService.php → backend/app/Services/FIB/CheckPaymentStatusService.php
Normal file → Executable file
2
backend/app/User/Services/FIB/CheckPaymentStatusService.php → backend/app/Services/FIB/CheckPaymentStatusService.php
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Services\FIB;
|
||||
namespace App\Services\FIB;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
2
backend/app/User/Services/FIB/CreatePaymentService.php → backend/app/Services/FIB/CreatePaymentService.php
Normal file → Executable file
2
backend/app/User/Services/FIB/CreatePaymentService.php → backend/app/Services/FIB/CreatePaymentService.php
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Services\FIB;
|
||||
namespace App\Services\FIB;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
2
backend/app/User/Services/FIB/RefundService.php → backend/app/Services/FIB/RefundService.php
Normal file → Executable file
2
backend/app/User/Services/FIB/RefundService.php → backend/app/Services/FIB/RefundService.php
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Services\FIB;
|
||||
namespace App\Services\FIB;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
14
backend/app/User/Controllers/AuthController.php
Normal file → Executable file
14
backend/app/User/Controllers/AuthController.php
Normal file → Executable file
@@ -18,12 +18,14 @@ class AuthController extends Controller
|
||||
|
||||
public function register(RegisterRequest $request): JsonResponse
|
||||
{
|
||||
User::query()->create([
|
||||
$user = User::query()->create([
|
||||
'username' => $request->username,
|
||||
'email' => $request->email,
|
||||
'password' => Hash::make($request->password),
|
||||
]);
|
||||
|
||||
Auth::guard('web')->login($user);
|
||||
|
||||
$request->session()->regenerate();
|
||||
|
||||
return $this->successResponse();
|
||||
@@ -43,13 +45,7 @@ class AuthController extends Controller
|
||||
{
|
||||
$request->session()->regenerate();
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
return $this->successResponse([
|
||||
'id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'email' => $user->email,
|
||||
]);
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
return $this->errorResponse(__('messages.incorrect_or_username_password'));
|
||||
@@ -57,7 +53,7 @@ class AuthController extends Controller
|
||||
|
||||
public function logout(Request $request): JsonResponse
|
||||
{
|
||||
Auth::logout();
|
||||
Auth::guard('web')->logout();
|
||||
|
||||
$request->session()->invalidate();
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Controllers\Dashboard;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ConfirmController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Controller\Dashboard;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Traits\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DocumentationController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function store(StoreRequest $request): jsonResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function update(UpdateRequest $request): JsonResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
42
backend/app/User/Controllers/DocumentationController.php
Executable file
42
backend/app/User/Controllers/DocumentationController.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Controllers;
|
||||
|
||||
use App\Facades\File\FileFacade;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Traits\ApiResponse;
|
||||
use App\User\Requests\Documentation\EditRequest;
|
||||
use App\User\Requests\Documentation\UploadRequest;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class DocumentationController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function upload(UploadRequest $request): jsonResponse
|
||||
{
|
||||
$user = Auth::guard('web')->user();
|
||||
|
||||
foreach ($request->documents as $document) {
|
||||
$user->documents()->create([
|
||||
'title' => $document['title'],
|
||||
'url' => FileFacade::save($document['file'], "/{$user->id}/documents", $document['title']),
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function edit(EditRequest $request): JsonResponse
|
||||
{
|
||||
$user = Auth::guard('web')->user();
|
||||
|
||||
foreach ($request->documents as $document) {
|
||||
$user->documents()->sync();
|
||||
}
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
}
|
||||
87
backend/app/User/Controllers/GatewayManagementController.php
Normal file
87
backend/app/User/Controllers/GatewayManagementController.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Controllers;
|
||||
|
||||
use App\Enums\BusinessTypeEnum;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Facades\File\FileFacade;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\UserGateway;
|
||||
use App\Traits\ApiResponse;
|
||||
use App\User\Requests\Gateway\StoreRequest;
|
||||
use App\User\Requests\Gateway\UpdateRequest;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class GatewayManagementController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
return DataTableFacade::run(
|
||||
UserGateway::query()->where('user_id', '=', Auth::guard('web')->id()),
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
allowedSelects: ['id', 'name', 'domain', 'tax_id', 'bank_name', 'account_holder', 'iban', 'business_type_id', 'business_type_name'],
|
||||
);
|
||||
}
|
||||
|
||||
public function store(StoreRequest $request): JsonResponse
|
||||
{
|
||||
$user = Auth::guard('web')->user();
|
||||
|
||||
$logo = $request->has('logo') ? FileFacade::save($request->file('logo'), "{$user->id}") : null;
|
||||
|
||||
UserGateway::query()->create([
|
||||
'user_id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'name' => $request->name,
|
||||
'domain' => $request->domain,
|
||||
'tax_id' => $request->tax_id,
|
||||
'bank_name' => $request->bank_name,
|
||||
'account_holder' => $request->account_holder,
|
||||
'iban' => $request->iban,
|
||||
'business_type_id' => $request->business_type_id,
|
||||
'business_type_name' => BusinessTypeEnum::name($request->business_type_id),
|
||||
'logo' => $logo,
|
||||
]);
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function show(UserGateway $gateway): JsonResponse
|
||||
{
|
||||
return $this->successResponse($gateway);
|
||||
}
|
||||
|
||||
public function update(UpdateRequest $request, UserGateway $gateway): JsonResponse
|
||||
{
|
||||
$logo = null;
|
||||
$user = Auth::guard('web')->user();
|
||||
|
||||
if ($request->has('logo'))
|
||||
{
|
||||
FileFacade::delete($gateway->logo, true);
|
||||
$logo = FileFacade::save(request()->file('logo'), "{$user->id}");
|
||||
}
|
||||
|
||||
$gateway->update([
|
||||
'name' => $request->name,
|
||||
'domain' => $request->domain,
|
||||
'business_type_id' => $request->business_type_id,
|
||||
'business_type_name' => BusinessTypeEnum::name($request->business_type_id),
|
||||
'logo' => $logo,
|
||||
]);
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function destroy(UserGateway $gateway): JsonResponse
|
||||
{
|
||||
$gateway->delete();
|
||||
return $this->successResponse();
|
||||
}
|
||||
}
|
||||
0
backend/app/User/Controllers/ProfileController.php
Normal file → Executable file
0
backend/app/User/Controllers/ProfileController.php
Normal file → Executable file
0
backend/app/User/Requests/Auth/LoginRequest.php
Normal file → Executable file
0
backend/app/User/Requests/Auth/LoginRequest.php
Normal file → Executable file
0
backend/app/User/Requests/Auth/RegisterRequest.php
Normal file → Executable file
0
backend/app/User/Requests/Auth/RegisterRequest.php
Normal file → Executable file
31
backend/app/User/Requests/Documentation/EditRequest.php
Executable file
31
backend/app/User/Requests/Documentation/EditRequest.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Requests\Documentation;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class EditRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'documents' => 'required|array',
|
||||
'documents.*.file' => 'required|file|mimes:pdf,jpg,jpeg,png|max:2048',
|
||||
'documents.*.title' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
31
backend/app/User/Requests/Documentation/UploadRequest.php
Executable file
31
backend/app/User/Requests/Documentation/UploadRequest.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Requests\Documentation;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UploadRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'documents' => 'required|array',
|
||||
'documents.*.file' => 'required|file|mimes:pdf,jpg,jpeg,png|max:2048',
|
||||
'documents.*.title' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
36
backend/app/User/Requests/Gateway/StoreRequest.php
Normal file
36
backend/app/User/Requests/Gateway/StoreRequest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Requests\Gateway;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'domain' => 'required|string|max:255',
|
||||
'tax_id' => 'required|string',
|
||||
'bank_name' => 'required|string|max:255',
|
||||
'account_holder' => 'required|string',
|
||||
'iban' => 'required|string|max:255',
|
||||
'logo' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',
|
||||
'business_type_id' => 'required|string|exists:business_types,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
32
backend/app/User/Requests/Gateway/UpdateRequest.php
Normal file
32
backend/app/User/Requests/Gateway/UpdateRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Requests\Gateway;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'domain' => 'required|string|max:255',
|
||||
'business_type_id' => 'required|string|exists:business_types,id',
|
||||
'logo' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',
|
||||
];
|
||||
}
|
||||
}
|
||||
0
backend/app/User/Requests/Profile/ChangePasswordRequest.php
Normal file → Executable file
0
backend/app/User/Requests/Profile/ChangePasswordRequest.php
Normal file → Executable file
0
backend/app/User/Requests/Profile/EditRequest.php
Normal file → Executable file
0
backend/app/User/Requests/Profile/EditRequest.php
Normal file → Executable file
0
backend/app/User/Resources/UserResource.php
Normal file → Executable file
0
backend/app/User/Resources/UserResource.php
Normal file → Executable file
0
backend/artisan
Normal file → Executable file
0
backend/artisan
Normal file → Executable file
0
backend/bootstrap/providers.php
Normal file → Executable file
0
backend/bootstrap/providers.php
Normal file → Executable file
0
backend/composer.json
Normal file → Executable file
0
backend/composer.json
Normal file → Executable file
0
backend/composer.lock
generated
Normal file → Executable file
0
backend/composer.lock
generated
Normal file → Executable file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user