This commit is contained in:
2025-08-17 15:43:12 +03:30
parent 1b88fb0f0a
commit e90d3775e2
3 changed files with 14 additions and 3 deletions

View File

@@ -20,11 +20,13 @@ class LoginToProvinceController extends Controller
->value('ip');
$data = [
'user_id' => auth()->user()->id,
'user_id' => auth()->user()->username,
'token' => Hash::make(config('globalVariables.LOGIN_HASH_VALUE')),
'ip' => $province_ip,
];
auth()->user()->currentAccessToken()->delete();
return $this->successResponse($data);
}
}

View File

@@ -19,7 +19,7 @@ class VerifyAuthenticationController extends Controller
return $this->errorResponse('Invalid token');
}
$user = User::query()->findOrFail($request->user_id);
$user = User::query()->firstWhere('username', '=', $request->user_id);
$token = $user->createToken("{$user->username}", ['*'], now()->addWeek())->plainTextToken;

View File

@@ -2,9 +2,18 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
class Cdr extends Model
{
protected $table = 'cdr';
protected $table = 'asteriskcdrdb.cdr';
protected function recordingfile(): Attribute
{
return Attribute::make(
get: fn($value) => $value == null ? null : url('/') . 'recordingfiles/' . $value
);
}
}