Compare commits

...

4 Commits

148 changed files with 158 additions and 20 deletions

0
backend/.dockerignore Executable file → Normal file
View File

0
backend/.editorconfig Executable file → Normal file
View File

0
backend/.env.example Executable file → Normal file
View File

0
backend/.gitattributes vendored Executable file → Normal file
View File

0
backend/.gitignore vendored Executable file → Normal file
View File

0
backend/.npmrc Executable file → Normal file
View File

0
backend/Dockerfile Executable file → Normal file
View File

0
backend/Dockerfile.production Executable file → Normal file
View File

0
backend/README.md Executable file → Normal file
View File

0
backend/app/Admin/Controllers/AuthController.php Executable file → Normal file
View File

View File

View File

View File

20
backend/app/Admin/Controllers/ProfileController.php Executable file → Normal file
View File

@@ -3,6 +3,7 @@
namespace App\Admin\Controllers;
use App\Admin\Requests\Profile\ChangePasswordRequest;
use App\Admin\Requests\Profile\EditRequest;
use App\Admin\Resources\ExpertResource;
use App\Http\Controllers\Controller;
use App\Traits\ApiResponse;
@@ -19,6 +20,24 @@ class ProfileController extends Controller
return $this->successResponse(new ExpertResource(Auth::guard('expert')->user()));
}
public function edit(EditRequest $request): JsonResponse
{
$expert = $request->user('expert');
$expert->update([
'username' => $request->username,
'first_name' => $request->first_name,
'last_name' => $request->last_name,
'email' => $expert->email,
'national_id' => $request->national_id,
'phone_number' => $request->phone_number,
'province_id' => $request->province_id,
'city_id' => $request->city_id,
]);
return $this->successResponse();
}
public function changePassword(ChangePasswordRequest $request): JsonResponse
{
$expert = Auth::guard('expert')->user();
@@ -34,4 +53,5 @@ class ProfileController extends Controller
return $this->successResponse();
}
}

View File

0
backend/app/Admin/Requests/Auth/LoginRequest.php Executable file → Normal file
View File

0
backend/app/Admin/Requests/Auth/RegisterRequest.php Executable file → Normal file
View File

View File

View File

View File

View File

View File

View File

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Admin\Requests\Profile;
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 [
'username' => 'string|max:255',
'first_name' => 'string',
'last_name' => 'string',
'email' => 'string|email|max:255',
'national_id' => 'string',
'phone_number' => 'string',
'province_id' => 'string',
'city_id' => 'string',
];
}
}

View File

View File

View File

View File

0
backend/app/Admin/Resources/ExpertResource.php Executable file → Normal file
View File

0
backend/app/Facades/DataTable/DataTable.php Executable file → Normal file
View File

0
backend/app/Facades/DataTable/DataTableFacade.php Executable file → Normal file
View File

0
backend/app/Facades/File/File.php Executable file → Normal file
View File

0
backend/app/Facades/File/FileFacade.php Executable file → Normal file
View File

0
backend/app/Http/Controllers/Controller.php Executable file → Normal file
View File

0
backend/app/Mail/LoginNotificationMail.php Executable file → Normal file
View File

0
backend/app/Models/City.php Executable file → Normal file
View File

0
backend/app/Models/Document.php Executable file → Normal file
View File

0
backend/app/Models/Expert.php Executable file → Normal file
View File

0
backend/app/Models/Province.php Executable file → Normal file
View File

View File

@@ -10,8 +10,6 @@ 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'])]
@@ -26,14 +24,4 @@ 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();
}
}

View File

@@ -22,8 +22,6 @@ 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 Executable file → Normal file
View File

0
backend/app/Providers/FileServiceProvider.php Executable file → Normal file
View File

0
backend/app/Services/DataTable/DataTableInput.php Executable file → Normal file
View File

0
backend/app/Services/DataTable/DataTableService.php Executable file → Normal file
View File

0
backend/app/Services/DataTable/Enums/DataType.php Executable file → Normal file
View File

0
backend/app/Services/DataTable/Enums/SearchType.php Executable file → Normal file
View File

View File

View File

View File

0
backend/app/Services/DataTable/Filter/ApplyFilter.php Executable file → Normal file
View File

0
backend/app/Services/DataTable/Filter/Filter.php Executable file → Normal file
View File

View File

View File

0
backend/app/Services/DataTable/Sort/ApplySort.php Executable file → Normal file
View File

0
backend/app/Services/DataTable/Sort/Sort.php Executable file → Normal file
View File

View File

View File

View File

0
backend/app/User/Controllers/AuthController.php Executable file → Normal file
View File

View File

@@ -0,0 +1,14 @@
<?php
namespace App\User\Controllers\Dashboard;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class ConfirmController extends Controller
{
public function index()
{
//
}
}

View File

@@ -0,0 +1,24 @@
<?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
{
//
}
}

0
backend/app/User/Controllers/ProfileController.php Executable file → Normal file
View File

0
backend/app/User/Requests/Auth/LoginRequest.php Executable file → Normal file
View File

0
backend/app/User/Requests/Auth/RegisterRequest.php Executable file → Normal file
View File

View File

0
backend/app/User/Requests/Profile/EditRequest.php Executable file → Normal file
View File

0
backend/app/User/Resources/UserResource.php Executable file → Normal file
View File

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Services\FIB;
namespace App\User\Services\FIB;
use Exception;
use Illuminate\Http\Client\ConnectionException;

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Services\FIB;
namespace App\User\Services\FIB;
use Exception;
use Illuminate\Http\Client\ConnectionException;

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Services\FIB;
namespace App\User\Services\FIB;
use Exception;
use Illuminate\Http\Client\ConnectionException;

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Services\FIB;
namespace App\User\Services\FIB;
use Exception;
use Illuminate\Http\Client\ConnectionException;

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Services\FIB;
namespace App\User\Services\FIB;
use Exception;
use Illuminate\Http\Client\ConnectionException;

0
backend/artisan Executable file → Normal file
View File

0
backend/bootstrap/providers.php Executable file → Normal file
View File

0
backend/composer.json Executable file → Normal file
View File

0
backend/composer.lock generated Executable file → Normal file
View File

0
backend/config/app.php Executable file → Normal file
View File

0
backend/config/cache.php Executable file → Normal file
View File

0
backend/config/database.php Executable file → Normal file
View File

0
backend/config/fib.php Executable file → Normal file
View File

0
backend/config/filesystems.php Executable file → Normal file
View File

0
backend/config/logging.php Executable file → Normal file
View File

0
backend/config/mail.php Executable file → Normal file
View File

0
backend/config/passport.php Executable file → Normal file
View File

0
backend/config/permission.php Executable file → Normal file
View File

0
backend/config/queue.php Executable file → Normal file
View File

0
backend/config/services.php Executable file → Normal file
View File

0
backend/database/.gitignore vendored Executable file → Normal file
View File

0
backend/database/factories/CityFactory.php Executable file → Normal file
View File

0
backend/database/factories/DocumentFactory.php Executable file → Normal file
View File

0
backend/database/factories/ExpertFactory.php Executable file → Normal file
View File

Some files were not shown because too many files have changed in this diff Show More