From 2a7c74bceb94e40a9ff30732d4825cd881f28842 Mon Sep 17 00:00:00 2001 From: Abdul Kareem Date: Mon, 16 Feb 2026 23:46:16 +0300 Subject: [PATCH] Configure backend for PostgreSQL and fix auth password_hash mapping --- app/Http/Controllers/Api/AuthController.php | 4 ++-- app/Models/User.php | 6 +++--- composer.json | 1 - config/database.php | 2 +- config/queue.php | 4 ++-- phpunit.xml | 2 -- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Api/AuthController.php b/app/Http/Controllers/Api/AuthController.php index 3d9e65d..262c14f 100644 --- a/app/Http/Controllers/Api/AuthController.php +++ b/app/Http/Controllers/Api/AuthController.php @@ -38,7 +38,7 @@ class AuthController extends Controller 'last_name' => $lastName, 'email' => $validated['email'], 'phone' => $validated['phone'], - 'password' => Hash::make($validated['password']), + 'password_hash' => Hash::make($validated['password']), ]); $token = $user->createToken('mobile_token')->plainTextToken; @@ -66,7 +66,7 @@ public function login(Request $request) $user = User::where('email', $request->email)->first(); - if (!$user || !Hash::check($request->password, $user->password)) { + if (!$user || !Hash::check($request->password, $user->password_hash)) { return response()->json([ 'message' => 'Invalid credentials' ], 401); diff --git a/app/Models/User.php b/app/Models/User.php index a9276a5..a4d3c3c 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -28,7 +28,7 @@ class User extends Authenticatable 'last_name', 'email', 'phone', - 'password', + 'password_hash', ]; /** @@ -37,7 +37,7 @@ class User extends Authenticatable * @var list */ protected $hidden = [ - 'password', + 'password_hash', 'remember_token', ]; @@ -50,7 +50,7 @@ class User extends Authenticatable { return [ 'email_verified_at' => 'datetime', - 'password' => 'hashed', + 'password_hash' => 'hashed', ]; } diff --git a/composer.json b/composer.json index 6875678..fd2ffa7 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,6 @@ ], "post-create-project-cmd": [ "@php artisan key:generate --ansi", - "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"", "@php artisan migrate --graceful --ansi" ], "pre-package-uninstall": [ diff --git a/config/database.php b/config/database.php index df933e7..60224cb 100644 --- a/config/database.php +++ b/config/database.php @@ -16,7 +16,7 @@ return [ | */ - 'default' => env('DB_CONNECTION', 'sqlite'), + 'default' => env('DB_CONNECTION', 'pgsql'), /* |-------------------------------------------------------------------------- diff --git a/config/queue.php b/config/queue.php index 79c2c0a..e633605 100644 --- a/config/queue.php +++ b/config/queue.php @@ -103,7 +103,7 @@ return [ */ 'batching' => [ - 'database' => env('DB_CONNECTION', 'sqlite'), + 'database' => env('DB_CONNECTION', 'pgsql'), 'table' => 'job_batches', ], @@ -122,7 +122,7 @@ return [ 'failed' => [ 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), - 'database' => env('DB_CONNECTION', 'sqlite'), + 'database' => env('DB_CONNECTION', 'pgsql'), 'table' => 'failed_jobs', ], diff --git a/phpunit.xml b/phpunit.xml index d703241..04fd4c8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -23,8 +23,6 @@ - -