diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index dae25ac..b0f2144 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -16,6 +16,7 @@ use Illuminate\Support\Facades\Cache; use Laravel\Lumen\Routing\Controller; use Laravel\Socialite\Facades\Socialite; use Illuminate\Session\TokenMismatchException; +use phpDocumentor\Reflection\Location; use Symfony\Component\HttpFoundation\Response; class AuthController extends Controller @@ -69,7 +70,7 @@ class AuthController extends Controller $user = User::where('email', $request->email)->first(); if ($user && Hash::check($request->password, $user->password)) { - Auth::viaRequest('api', fn() => $user); + Auth::setUser($user); return [ 'auth' => $this->createFingerPrint(), @@ -252,11 +253,11 @@ class AuthController extends Controller public function createFingerPrint() { $attributes = [ - 'agent' => \request()->getAgent(), - 'ip' => \request()->getClientIp(), - 'os' => \request()->getOS(), - 'latitude' => \request()->getLocation()->getAttribute('lat'), - 'longitude' => \request()->getLocation()->getAttribute('lon'), + 'agent' => request()->getAgent(), + 'ip' => request()->getClientIp(), + 'os' => request()->getOS(), + 'latitude' => 5, + 'longitude' => 5, ]; $values = [ diff --git a/app/Http/Controllers/CreditController.php b/app/Http/Controllers/CreditController.php index e430404..d1f311b 100644 --- a/app/Http/Controllers/CreditController.php +++ b/app/Http/Controllers/CreditController.php @@ -2,7 +2,7 @@ namespace App\Http\Controllers; -use App\Transaction; +use App\Models\Transaction; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Spatie\QueryBuilder\QueryBuilder; diff --git a/app/Http/Controllers/FileController.php b/app/Http/Controllers/FileController.php index 88eac5b..63816f6 100644 --- a/app/Http/Controllers/FileController.php +++ b/app/Http/Controllers/FileController.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers; -use App\File; -use App\Project; +use App\Models\File; +use App\Models\Project; +use App\Rules\maxBound; use App\Models\Business; -use App\Rules\MaxBound; use Illuminate\Support\Str; use Illuminate\Http\Request; use Illuminate\Http\UploadedFile; diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index c277488..b6ee5ac 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -2,7 +2,7 @@ namespace App\Http\Controllers; -use App\Cost; +use App\Models\Cost; use App\Models\Business; use Illuminate\Http\Request; use Spatie\QueryBuilder\QueryBuilder; diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 5822f40..4a396ef 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -2,7 +2,7 @@ namespace App\Http\Controllers; -use App\Project; +use App\Models\Project; use App\Models\Business; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; diff --git a/app/Http/Controllers/SprintController.php b/app/Http/Controllers/SprintController.php index 46bcbf1..69d560c 100644 --- a/app/Http/Controllers/SprintController.php +++ b/app/Http/Controllers/SprintController.php @@ -1,10 +1,8 @@ singleton( | */ +$app->router->group([ + 'namespace' => 'App\Http\Controllers', + 'prefix' => '/user/v1/' +], function ($router) { + require __DIR__.'/../routes/api.php'; +}); + return $app;