Upgrade: Laravel 11, consolidación modelos App\Models\

- Actualización a Laravel 11.47.0
- Migración de modelos a namespace App\Models\
- Actualización de todos los controladores
- Actualización de configuraciones
- Documentación README.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-17 22:07:34 +00:00
parent 2751809502
commit 46469deaa8
241 changed files with 2797 additions and 1720 deletions

0
app/Console/Kernel.php Normal file → Executable file
View File

0
app/Exceptions/Handler.php Normal file → Executable file
View File

13
app/Http/Controllers/Auth/AuthController.php Normal file → Executable file
View File

@@ -2,13 +2,14 @@
namespace App\Http\Controllers\Auth;
use App\User;
use App\Verify_accounts;
use App\Models\User;
use App\Models\Verify_accounts;
use Carbon\Carbon;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Socialite;
use Route;
use Config;
@@ -152,7 +153,7 @@ class AuthController extends Controller
$verify->name = $request->name;
$verify->email = $request->email;
$verify->password = bcrypt($request->password);
$verify->token = str_random(70);
$verify->token = Str::random(70);
$verify->save(); */
@@ -168,9 +169,9 @@ class AuthController extends Controller
'message' => 'Successfully created user!'
], 201);
} else {
return response()->json([
'message' => 'Puto el que la hackee'
], 201);
return response()->json([
'message' => 'Unauthorized request'
], 401);
}
}
public function logout(Request $request)

0
app/Http/Controllers/Auth/ForgotPasswordController.php Normal file → Executable file
View File

2
app/Http/Controllers/Auth/LoginController.php Normal file → Executable file
View File

@@ -9,7 +9,7 @@ use Illuminate\Http\Request;
use Auth;
use Socialite;
use Route;
use App\User;
use App\Models\User;
class LoginController extends Controller
{

2
app/Http/Controllers/Auth/RegisterController.php Normal file → Executable file
View File

@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Auth;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;

0
app/Http/Controllers/Auth/ResetPasswordController.php Normal file → Executable file
View File

0
app/Http/Controllers/Auth/VerificationController.php Normal file → Executable file
View File

0
app/Http/Controllers/BanksController.php Normal file → Executable file
View File

0
app/Http/Controllers/CategoriesController.php Normal file → Executable file
View File

4
app/Http/Controllers/ContractController.php Normal file → Executable file
View File

@@ -3,7 +3,7 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use OneSignal;
use Openpay;
@@ -13,7 +13,7 @@ use OpenpayApiAuthError;
use OpenpayApiRequestError;
use OpenpayApiConnectionError;
use OpenpayApiTransactionError;
use App\iChambaParameter;
use App\Models\iChambaParameter;
use App\Models\Suppliers;
use App\Models\Categories;
use App\Models\Cards;

0
app/Http/Controllers/Controller.php Normal file → Executable file
View File

0
app/Http/Controllers/CouponController.php Normal file → Executable file
View File

0
app/Http/Controllers/HomeController.php Normal file → Executable file
View File

2
app/Http/Controllers/IChambaParameterController.php Normal file → Executable file
View File

@@ -2,7 +2,7 @@
namespace App\Http\Controllers;
use App\iChambaParameter;
use App\Models\iChambaParameter;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;

4
app/Http/Controllers/NoHomeController.php Normal file → Executable file
View File

@@ -2,8 +2,8 @@
namespace App\Http\Controllers;
use App\NoHome;
use App\User;
use App\Models\NoHome;
use App\Models\User;
use Carbon\Carbon;
use OneSignal;
use Image;

4
app/Http/Controllers/PaymentController.php Normal file → Executable file
View File

@@ -5,7 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Carbon\Carbon;
use App\User;
use App\Models\User;
use App\Models\Suppliers;
use App\Models\Payments;
use App\Models\FinishedContracts;
@@ -18,8 +18,6 @@ use OpenpayApiRequestError;
use OpenpayApiConnectionError;
use OpenpayApiTransactionError;
require_once '../vendor/autoload.php';
class PaymentController extends Controller
{
//

2
app/Http/Controllers/PostulationController.php Normal file → Executable file
View File

@@ -3,7 +3,7 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use OneSignal;
use App\Models\Suppliers;

4
app/Http/Controllers/ReportCommentController.php Normal file → Executable file
View File

@@ -2,9 +2,9 @@
namespace App\Http\Controllers;
use App\ReportComment;
use App\Models\ReportComment;
use App\Models\FinishedContracts;
use App\NoHome;
use App\Models\NoHome;
use Illuminate\Http\Request;
class ReportCommentController extends Controller

6
app/Http/Controllers/ReportController.php Normal file → Executable file
View File

@@ -2,9 +2,9 @@
namespace App\Http\Controllers;
use App\User;
use App\Report;
use App\ReportComment;
use App\Models\User;
use App\Models\Report;
use App\Models\ReportComment;
use App\Models\FinishedContracts;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

0
app/Http/Controllers/StatusController.php Normal file → Executable file
View File

4
app/Http/Controllers/SupplierController.php Normal file → Executable file
View File

@@ -7,8 +7,8 @@ use OneSignal;
use Storage;
use Illuminate\Http\Request;
use Carbon\Carbon;
use App\User;
use App\iChambaParameter;
use App\Models\User;
use App\Models\iChambaParameter;
use App\Models\Suppliers;
use App\Models\Banks;
use App\Models\Categories;

2
app/Http/Controllers/UserController.php Normal file → Executable file
View File

@@ -3,7 +3,7 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use App\Models\User;
use Illuminate\Support\Facades\Validator;
class UserController extends Controller

0
app/Http/Kernel.php Normal file → Executable file
View File

0
app/Http/Middleware/AppEngineCron.php Normal file → Executable file
View File

0
app/Http/Middleware/Authenticate.php Normal file → Executable file
View File

0
app/Http/Middleware/CheckForMaintenanceMode.php Normal file → Executable file
View File

0
app/Http/Middleware/Cors.php Normal file → Executable file
View File

0
app/Http/Middleware/EncryptCookies.php Normal file → Executable file
View File

0
app/Http/Middleware/RedirectIfAuthenticated.php Normal file → Executable file
View File

0
app/Http/Middleware/RoleCheck.php Normal file → Executable file
View File

0
app/Http/Middleware/SuperAdmin.php Normal file → Executable file
View File

0
app/Http/Middleware/TrimStrings.php Normal file → Executable file
View File

11
app/Http/Middleware/TrustProxies.php Normal file → Executable file
View File

@@ -2,15 +2,15 @@
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string
* @var array<int, string>|string|null
*/
protected $proxies;
@@ -19,5 +19,10 @@ class TrustProxies extends Middleware
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_FOR;
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}

0
app/Http/Middleware/VerifyCsrfToken.php Normal file → Executable file
View File

2
app/Models/Banks.php Normal file → Executable file
View File

@@ -2,7 +2,7 @@
namespace App\Models;
use App\User;
use App\Models\User;
use App\Models\Suppliers;
use Illuminate\Database\Eloquent\Model;

2
app/Models/Cards.php Normal file → Executable file
View File

@@ -2,7 +2,7 @@
namespace App\Models;
use App\User;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
class Cards extends Model

2
app/Models/Categories.php Normal file → Executable file
View File

@@ -2,7 +2,7 @@
namespace App\Models;
use App\User;
use App\Models\User;
use App\Models\Suppliers;
use App\Models\Postulations;
use App\Models\CurrentContracts;

0
app/Models/Coupon.php Normal file → Executable file
View File

2
app/Models/CurrentContracts.php Normal file → Executable file
View File

@@ -2,7 +2,7 @@
namespace App\Models;
use App\User;
use App\Models\User;
use App\Models\Categories;
use App\Models\Suppliers;
use App\Models\Coupon;

4
app/Models/FinishedContracts.php Normal file → Executable file
View File

@@ -2,14 +2,14 @@
namespace App\Models;
use App\User;
use App\Models\User;
use App\Models\Categories;
use App\Models\Suppliers;
use App\Models\Coupon;
use App\Models\Status;
use App\Models\Report;
use App\Models\Payments;
use App\NoHome;
use App\Models\NoHome;
use Illuminate\Database\Eloquent\Model;
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;

2
app/Models/LinkedSocialAccount.php Normal file → Executable file
View File

@@ -2,7 +2,7 @@
namespace App\Models;
use App\User;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
class LinkedSocialAccount extends Model

View File

@@ -1,6 +1,6 @@
<?php
namespace App;
namespace App\Models;
use App\Models\FinishedContracts;

0
app/Models/Payments.php Normal file → Executable file
View File

2
app/Models/Postulations.php Normal file → Executable file
View File

@@ -2,7 +2,7 @@
namespace App\Models;
use App\User;
use App\Models\User;
use App\Models\Categories;
use App\Models\Suppliers;
use App\Models\Status;

View File

@@ -1,9 +1,10 @@
<?php
namespace App;
namespace App\Models;
use App\User;
use App\Models\User;
use App\Models\FinishedContracts;
use App\Models\ReportComment;
use Illuminate\Database\Eloquent\Model;
@@ -24,7 +25,7 @@ class Report extends Model
public function user()
{
return $this->belongsTo('App\User', 'moderator_id');
return $this->belongsTo(User::class, 'moderator_id');
}
public function reportcomments()

View File

@@ -1,9 +1,9 @@
<?php
namespace App;
namespace App\Models;
use App\User;
use App\Report;
use App\Models\User;
use App\Models\Report;
use Illuminate\Database\Eloquent\Model;

View File

@@ -1,8 +1,8 @@
<?php
namespace App;
namespace App\Models;
use App\User;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
class Role extends Model

0
app/Models/Status.php Normal file → Executable file
View File

4
app/Models/Suppliers.php Normal file → Executable file
View File

@@ -2,8 +2,8 @@
namespace App\Models;
use App\User;
use App\iChambaParameter;
use App\Models\User;
use App\Models\iChambaParameter;
use App\Models\Banks;
use App\Models\Categories;
use App\Models\Postulations;

View File

@@ -1,14 +1,16 @@
<?php
namespace App;
namespace App\Models;
use App\Role;
use App\Models\Role;
use App\Models\LinkedSocialAccount;
use App\Models\Cards;
use App\Models\Suppliers;
use App\Models\Postulations;
use App\Report;
use App\ReportComment;
use App\Models\Report;
use App\Models\ReportComment;
use App\Models\CurrentContracts;
use App\Models\FinishedContracts;
use Laravel\Passport\HasApiTokens;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Notifications\Notifiable;
@@ -89,6 +91,6 @@ class User extends Authenticatable
public function roles()
{
return $this->belongsTo('App\Role', 'role_id');
return $this->belongsTo(Role::class, 'role_id');
}
}

View File

@@ -1,6 +1,6 @@
<?php
namespace App;
namespace App\Models;
use Illuminate\Database\Eloquent\Model;

View File

@@ -1,6 +1,6 @@
<?php
namespace App;
namespace App\Models;
use App\Models\Suppliers;
use Illuminate\Database\Eloquent\Model;

0
app/Notifications/PasswordReset.php Normal file → Executable file
View File

0
app/Providers/AppServiceProvider.php Normal file → Executable file
View File

8
app/Providers/AuthServiceProvider.php Normal file → Executable file
View File

@@ -2,7 +2,6 @@
namespace App\Providers;
use Laravel\Passport\Passport;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
@@ -22,11 +21,8 @@ class AuthServiceProvider extends ServiceProvider
*
* @return void
*/
public function boot()
public function boot(): void
{
$this->registerPolicies();
Passport::routes();
//
// Passport routes are now registered automatically in Laravel Passport 12
}
}

0
app/Providers/BroadcastServiceProvider.php Normal file → Executable file
View File

0
app/Providers/EventServiceProvider.php Normal file → Executable file
View File

0
app/Providers/RouteServiceProvider.php Normal file → Executable file
View File

2
app/Services/SocialAccountsService.php Normal file → Executable file
View File

@@ -2,7 +2,7 @@
namespace App\Services;
use Storage;
use App\User;
use App\Models\User;
use App\Models\LinkedSocialAccount;
use Laravel\Socialite\Two\User as ProviderUser;
use Illuminate\Support\Facades\File;

0
app/Services/SocialUserResolver.php Normal file → Executable file
View File