diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 6d41a8d..b0f2144 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -2,9 +2,9 @@ namespace App\Http\Controllers; -use App\User; -use App\Business; -use App\Fingerprint; +use App\Models\User; +use App\Models\Business; +use App\Models\Fingerprint; use Illuminate\Support\Str; use Illuminate\Http\Request; use Illuminate\Validation\Rule; @@ -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/BusinessController.php b/app/Http/Controllers/BusinessController.php index 179837c..633f162 100644 --- a/app/Http/Controllers/BusinessController.php +++ b/app/Http/Controllers/BusinessController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers; -use App\User; -use App\Business; +use App\Models\User; +use App\Models\Business; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; 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 b57455c..1fc8394 100644 --- a/app/Http/Controllers/FileController.php +++ b/app/Http/Controllers/FileController.php @@ -2,9 +2,9 @@ namespace App\Http\Controllers; -use App\File; -use App\Project; -use App\Business; +use App\Models\File; +use App\Models\Project; +use App\Models\Business; use App\Rules\maxBound; use Illuminate\Support\Str; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 1bf3ea2..b6ee5ac 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers; -use App\Cost; -use App\Business; +use App\Models\Cost; +use App\Models\Business; use Illuminate\Http\Request; use Spatie\QueryBuilder\QueryBuilder; use Spatie\QueryBuilder\AllowedFilter; diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 707625d..4a396ef 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers; -use App\Project; -use App\Business; +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 7f26dcd..446f780 100644 --- a/app/Http/Controllers/SprintController.php +++ b/app/Http/Controllers/SprintController.php @@ -4,8 +4,8 @@ namespace App\Http\Controllers; -use App\Business; -use App\Sprint; +use App\Models\Business; +use App\Models\Sprint; use Illuminate\Http\Request; class SprintController extends Controller diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php index 7740503..f5959f5 100644 --- a/app/Http/Controllers/StatusController.php +++ b/app/Http/Controllers/StatusController.php @@ -4,8 +4,8 @@ namespace App\Http\Controllers; -use App\Business; -use App\Status; +use App\Models\Business; +use App\Models\Status; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Validation\Rule; diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index aadc34b..b2d5d00 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers; -use App\Business; -use App\System; +use App\Models\Business; +use App\Models\System; use Illuminate\Http\Request; class SystemController extends Controller diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 7d661ba..a00e53f 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -4,9 +4,9 @@ namespace App\Http\Controllers; -use App\Business; -use App\Tag; -use App\Workflow; +use App\Models\Business; +use App\Models\Tag; +use App\Models\Workflow; use Illuminate\Http\Request; class TagController extends Controller diff --git a/app/Http/Controllers/TaskController.php b/app/Http/Controllers/TaskController.php index f447782..f6e28cd 100644 --- a/app/Http/Controllers/TaskController.php +++ b/app/Http/Controllers/TaskController.php @@ -5,7 +5,7 @@ namespace App\Http\Controllers; use App\Http\Resources\TaskCollection; use App\Http\Resources\TaskResource; use App\Rules\maxBound; -use App\TagTask; +use App\Models\TagTask; use App\Models\Task; use App\Models\Work; use Carbon\Carbon; diff --git a/app/Http/Controllers/TaskFileController.php b/app/Http/Controllers/TaskFileController.php index ab35061..3c2c177 100644 --- a/app/Http/Controllers/TaskFileController.php +++ b/app/Http/Controllers/TaskFileController.php @@ -3,10 +3,10 @@ namespace App\Http\Controllers; use Auth; -use App\File; -use App\Task; -use App\Project; -use App\Business; +use App\Models\File; +use App\Models\Task; +use App\Models\Project; +use App\Models\Business; use Illuminate\Http\Exceptions\HttpResponseException; use Illuminate\Http\Request; use App\Http\Controllers\Controller; diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index fba4e8d..ae42af8 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -4,7 +4,7 @@ namespace App\Http\Controllers; -use App\User; +use App\Models\User; use Illuminate\Http\Request; use Spatie\QueryBuilder\AllowedFilter; use Spatie\QueryBuilder\QueryBuilder; diff --git a/app/Http/Controllers/WorkflowController.php b/app/Http/Controllers/WorkflowController.php index 80fdc3d..27f5c14 100644 --- a/app/Http/Controllers/WorkflowController.php +++ b/app/Http/Controllers/WorkflowController.php @@ -4,9 +4,9 @@ namespace App\Http\Controllers; -use App\Business; -use App\Status; -use App\Workflow; +use App\Models\Business; +use App\Models\Status; +use App\Models\Workflow; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; diff --git a/app/Models/Business.php b/app/Models/Business.php index 671366c..eaab90f 100644 --- a/app/Models/Business.php +++ b/app/Models/Business.php @@ -2,14 +2,14 @@ namespace App\Models; -use App\File; +use App\Models\File; use App\Models\Model; use App\Models\SoftDeletes; +use App\Models\ReportableRelation; use Illuminate\Validation\Rule; use Illuminate\Http\UploadedFile; use Spatie\MediaLibrary\HasMedia; use Illuminate\Support\Facades\Cache; -use App\HiLib\Models\ReportableRelation; use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\MediaLibrary\MediaCollections\Models\Media; diff --git a/app/Models/Project.php b/app/Models/Project.php index 7854d46..d9aca59 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -2,13 +2,13 @@ namespace App\Models; -use App\File; +use App\Models\File; use App\Models\Model; use App\Models\SoftDeletes; +use App\Models\ReportableRelation; use Illuminate\Validation\Rule; use Illuminate\Http\UploadedFile; use Spatie\MediaLibrary\HasMedia; -use App\HiLib\Models\ReportableRelation; use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\MediaLibrary\MediaCollections\Models\Media; diff --git a/app/Models/ReportableRelation.php b/app/Models/ReportableRelation.php index 0c23b48..b8b5d07 100644 --- a/app/Models/ReportableRelation.php +++ b/app/Models/ReportableRelation.php @@ -1,6 +1,6 @@ singleton( | */ +$app->router->group([ + 'namespace' => 'App\Http\Controllers', + 'prefix' => '/user/v1/' +], function ($router) { + require __DIR__.'/../routes/api.php'; +}); + return $app;