Skip to content

Commit

Permalink
chore: Changed default user model location
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Aug 13, 2024
1 parent 274989a commit 0ff9ec7
Show file tree
Hide file tree
Showing 26 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion app/Classes/Authentication/Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Models\AuthLog;
use App\Models\Permission;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
Expand Down
2 changes: 1 addition & 1 deletion app/Classes/Authentication/KeycloakAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Classes\Authentication;

use App\Models\Oauth2Token;
use App\User;
use App\Models\User;
use GuzzleHttp\Client;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Hash;
Expand Down
2 changes: 1 addition & 1 deletion app/Classes/Authentication/LDAPAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use App\Models\RoleUser;
use App\Models\Server;
use App\Models\UserSettings;
use App\User;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use App\Classes\Authentication\LimanAuthenticator;
use App\Http\Controllers\Controller;
use App\Models\SystemSettings;
use App\User;
use App\Models\User;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use App\Models\Permission;
use App\Models\Server;
use App\Models\UserExtensionUsageStats;
use App\User;
use App\Models\User;

/**
* Dashboard Controller
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use App\User;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/Server/AccessLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use App\Models\Extension;
use App\Models\Permission;
use App\System\Command;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Http\Response;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/Settings/HealthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use App\Http\Controllers\Controller;
use App\Jobs\HighAvailabilitySyncer;
use App\System\Command;
use App\User;
use App\Models\User;
use Illuminate\Contracts\Bus\Dispatcher;

class HealthController extends Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use App\Http\Controllers\Controller;
use App\Models\LdapRestriction;
use App\Models\RoleMapping;
use App\User;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/Settings/RoleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use App\Models\Role;
use App\Models\RoleUser;
use App\Models\Server;
use App\User;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/Settings/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use App\Models\Permission;
use App\Models\Role;
use App\Models\RoleUser;
use App\User;
use App\Models\User;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/APILogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Middleware;

use App\Models\AccessToken;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use Closure;
use Illuminate\Support\Facades\Auth;
Expand Down
2 changes: 1 addition & 1 deletion app/Models/AuditLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Casts\Jsonb;
use App\Support\Database\CacheQueryBuilder;
use App\User;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;

class AuditLog extends Model
Expand Down
2 changes: 1 addition & 1 deletion app/Models/AuthLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Models;

use App\Support\Database\CacheQueryBuilder;
use App\User;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;

class AuthLog extends Model
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Models;

use App\Casts\Jsonb;
use App\User;
use App\Models\User;
use Illuminate\Database\Eloquent\Concerns\HasEvents;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Models;

use App\Support\Database\CacheQueryBuilder;
use App\User;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;

Expand Down
2 changes: 1 addition & 1 deletion app/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public function permissions()
*/
public function users()
{
return $this->belongsToMany('App\User', 'role_users');
return $this->belongsToMany('App\Models\User', 'role_users');
}
}
2 changes: 1 addition & 1 deletion app/Models/RoleUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class RoleUser extends Model
*/
public function user()
{
return $this->belongsTo('App\User');
return $this->belongsTo('App\Models\User');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/User.php → app/Models/User.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace App\Models;

use App\Models\Extension;
use App\Models\Permission;
Expand All @@ -18,7 +18,7 @@
use Tymon\JWTAuth\Contracts\JWTSubject as JWTSubject;

/**
* App\User
* App\Models\User
*
* @property-read mixed $id
*
Expand Down
6 changes: 3 additions & 3 deletions app/Observers/UserObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

use App\Mail\Information;
use App\Models\Notification;
use App\User;
use App\Models\User;
use Illuminate\Support\Facades\Mail;

class UserObserver
{
/**
* Listen to the User created event.
*
* @param \App\User $user
* @param \App\Models\User $user
* @return void
*/
public function created(User $user)
Expand Down Expand Up @@ -40,7 +40,7 @@ public function created(User $user)
/**
* Listen to the User updating event.
*
* @param \App\User $user
* @param \App\Models\User $user
* @return void
*/
public function updating(User $user)
Expand Down
2 changes: 1 addition & 1 deletion app/Policies/ServerPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Models\Permission;
use App\Models\Server;
use App\User;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use App\Observers\NotificationObserver;
use App\Observers\ServerObserver;
use App\Observers\UserObserver;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Contracts\Http\Kernel;
Expand Down Expand Up @@ -40,7 +40,7 @@ public function boot(
Server::observe(ServerObserver::class);

Relation::morphMap([
'users' => 'App\User',
'users' => 'App\Models\User',
'roles' => 'App\Models\Role',
]);

Expand Down
2 changes: 1 addition & 1 deletion config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
'model' => App\Models\User::class,
],

// 'users' => [
Expand Down
2 changes: 1 addition & 1 deletion config/jwt.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
|
| This will determine whether a `prv` claim is automatically added to
| the token. The purpose of this is to ensure that if you have multiple
| authentication models e.g. `App\User` & `App\OtherPerson`, then we
| authentication models e.g. `App\Models\User` & `App\OtherPerson`, then we
| should prevent one authentication request from impersonating another,
| if 2 tokens happen to have the same id across the 2 different models.
|
Expand Down
2 changes: 1 addition & 1 deletion config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],

'stripe' => [
'model' => App\User::class,
'model' => App\Models\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
'webhook' => [
Expand Down
2 changes: 1 addition & 1 deletion database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
|
*/

$factory->define(App\User::class, function (Faker $faker) {
$factory->define(App\Models\User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
Expand Down

0 comments on commit 0ff9ec7

Please sign in to comment.