Browse Source

fix namespaces in models, login bug fix

pull/2/head
mahdihty 4 years ago
parent
commit
d08258ebb9
  1. 19
      app/Http/Controllers/AuthController.php
  2. 4
      app/Http/Controllers/BusinessController.php
  3. 2
      app/Http/Controllers/CreditController.php
  4. 6
      app/Http/Controllers/FileController.php
  5. 4
      app/Http/Controllers/InvoiceController.php
  6. 4
      app/Http/Controllers/ProjectController.php
  7. 4
      app/Http/Controllers/SprintController.php
  8. 4
      app/Http/Controllers/StatusController.php
  9. 4
      app/Http/Controllers/SystemController.php
  10. 6
      app/Http/Controllers/TagController.php
  11. 2
      app/Http/Controllers/TaskController.php
  12. 8
      app/Http/Controllers/TaskFileController.php
  13. 2
      app/Http/Controllers/UserController.php
  14. 6
      app/Http/Controllers/WorkflowController.php
  15. 4
      app/Models/Business.php
  16. 4
      app/Models/Project.php
  17. 2
      app/Models/ReportableRelation.php
  18. 2
      app/Models/Task.php
  19. 4
      app/Models/User.php
  20. 7
      bootstrap/app.php

19
app/Http/Controllers/AuthController.php

@ -2,9 +2,9 @@
namespace App\Http\Controllers; 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\Support\Str;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
@ -16,6 +16,7 @@ use Illuminate\Support\Facades\Cache;
use Laravel\Lumen\Routing\Controller; use Laravel\Lumen\Routing\Controller;
use Laravel\Socialite\Facades\Socialite; use Laravel\Socialite\Facades\Socialite;
use Illuminate\Session\TokenMismatchException; use Illuminate\Session\TokenMismatchException;
use phpDocumentor\Reflection\Location;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
class AuthController extends Controller class AuthController extends Controller
@ -69,7 +70,7 @@ class AuthController extends Controller
$user = User::where('email', $request->email)->first(); $user = User::where('email', $request->email)->first();
if ($user && Hash::check($request->password, $user->password)) { if ($user && Hash::check($request->password, $user->password)) {
Auth::viaRequest('api', fn() => $user);
Auth::setUser($user);
return [ return [
'auth' => $this->createFingerPrint(), 'auth' => $this->createFingerPrint(),
@ -252,11 +253,11 @@ class AuthController extends Controller
public function createFingerPrint() public function createFingerPrint()
{ {
$attributes = [ $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 = [ $values = [

4
app/Http/Controllers/BusinessController.php

@ -2,8 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\User;
use App\Business;
use App\Models\User;
use App\Models\Business;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;

2
app/Http/Controllers/CreditController.php

@ -2,7 +2,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Transaction;
use App\Models\Transaction;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Spatie\QueryBuilder\QueryBuilder; use Spatie\QueryBuilder\QueryBuilder;

6
app/Http/Controllers/FileController.php

@ -2,9 +2,9 @@
namespace App\Http\Controllers; 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 App\Rules\maxBound;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Illuminate\Http\Request; use Illuminate\Http\Request;

4
app/Http/Controllers/InvoiceController.php

@ -2,8 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Cost;
use App\Business;
use App\Models\Cost;
use App\Models\Business;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Spatie\QueryBuilder\QueryBuilder; use Spatie\QueryBuilder\QueryBuilder;
use Spatie\QueryBuilder\AllowedFilter; use Spatie\QueryBuilder\AllowedFilter;

4
app/Http/Controllers/ProjectController.php

@ -2,8 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Project;
use App\Business;
use App\Models\Project;
use App\Models\Business;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;

4
app/Http/Controllers/SprintController.php

@ -4,8 +4,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Business;
use App\Sprint;
use App\Models\Business;
use App\Models\Sprint;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class SprintController extends Controller class SprintController extends Controller

4
app/Http/Controllers/StatusController.php

@ -4,8 +4,8 @@
namespace App\Http\Controllers; 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\Request;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;

4
app/Http/Controllers/SystemController.php

@ -2,8 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Business;
use App\System;
use App\Models\Business;
use App\Models\System;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class SystemController extends Controller class SystemController extends Controller

6
app/Http/Controllers/TagController.php

@ -4,9 +4,9 @@
namespace App\Http\Controllers; 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; use Illuminate\Http\Request;
class TagController extends Controller class TagController extends Controller

2
app/Http/Controllers/TaskController.php

@ -5,7 +5,7 @@ namespace App\Http\Controllers;
use App\Http\Resources\TaskCollection; use App\Http\Resources\TaskCollection;
use App\Http\Resources\TaskResource; use App\Http\Resources\TaskResource;
use App\Rules\maxBound; use App\Rules\maxBound;
use App\TagTask;
use App\Models\TagTask;
use App\Models\Task; use App\Models\Task;
use App\Models\Work; use App\Models\Work;
use Carbon\Carbon; use Carbon\Carbon;

8
app/Http/Controllers/TaskFileController.php

@ -3,10 +3,10 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Auth; 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\Exceptions\HttpResponseException;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;

2
app/Http/Controllers/UserController.php

@ -4,7 +4,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\User;
use App\Models\User;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Spatie\QueryBuilder\AllowedFilter; use Spatie\QueryBuilder\AllowedFilter;
use Spatie\QueryBuilder\QueryBuilder; use Spatie\QueryBuilder\QueryBuilder;

6
app/Http/Controllers/WorkflowController.php

@ -4,9 +4,9 @@
namespace App\Http\Controllers; 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\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;

4
app/Models/Business.php

@ -2,14 +2,14 @@
namespace App\Models; namespace App\Models;
use App\File;
use App\Models\File;
use App\Models\Model; use App\Models\Model;
use App\Models\SoftDeletes; use App\Models\SoftDeletes;
use App\Models\ReportableRelation;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Illuminate\Http\UploadedFile; use Illuminate\Http\UploadedFile;
use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\HasMedia;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use App\HiLib\Models\ReportableRelation;
use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media; use Spatie\MediaLibrary\MediaCollections\Models\Media;

4
app/Models/Project.php

@ -2,13 +2,13 @@
namespace App\Models; namespace App\Models;
use App\File;
use App\Models\File;
use App\Models\Model; use App\Models\Model;
use App\Models\SoftDeletes; use App\Models\SoftDeletes;
use App\Models\ReportableRelation;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Illuminate\Http\UploadedFile; use Illuminate\Http\UploadedFile;
use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\HasMedia;
use App\HiLib\Models\ReportableRelation;
use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media; use Spatie\MediaLibrary\MediaCollections\Models\Media;

2
app/Models/ReportableRelation.php

@ -1,6 +1,6 @@
<?php <?php
namespace App\Utilities\Models;
namespace App\Models;
use Anik\Amqp\Exchange; use Anik\Amqp\Exchange;
use Anik\Amqp\Facades\Amqp; use Anik\Amqp\Facades\Amqp;

2
app/Models/Task.php

@ -2,6 +2,7 @@
namespace App\Models; namespace App\Models;
use App\Models\ReportableRelation;
use Carbon\Carbon; use Carbon\Carbon;
use App\Models\Tag; use App\Models\Tag;
use App\Models\User; use App\Models\User;
@ -13,7 +14,6 @@ use App\Models\TagTask;
use App\Models\Business; use App\Models\Business;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use App\HiLib\Models\ReportableRelation;
use Illuminate\Validation\Rules\RequiredIf; use Illuminate\Validation\Rules\RequiredIf;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;

4
app/Models/User.php

@ -2,15 +2,15 @@
namespace App\Models; namespace App\Models;
use App\File;
use App\Models\File;
use App\Models\Model; use App\Models\Model;
use App\Models\SoftDeletes; use App\Models\SoftDeletes;
use App\Models\ReportableRelation;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Illuminate\Http\UploadedFile; use Illuminate\Http\UploadedFile;
use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\HasMedia;
use Illuminate\Auth\Authenticatable; use Illuminate\Auth\Authenticatable;
use Laravel\Lumen\Auth\Authorizable; use Laravel\Lumen\Auth\Authorizable;
use App\HiLib\Models\ReportableRelation;
use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media; use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;

7
bootstrap/app.php

@ -52,4 +52,11 @@ $app->singleton(
| |
*/ */
$app->router->group([
'namespace' => 'App\Http\Controllers',
'prefix' => '/user/v1/'
], function ($router) {
require __DIR__.'/../routes/api.php';
});
return $app; return $app;
Loading…
Cancel
Save