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:
2
app/Models/Banks.php
Normal file → Executable file
2
app/Models/Banks.php
Normal file → Executable 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
2
app/Models/Cards.php
Normal file → Executable 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
2
app/Models/Categories.php
Normal file → Executable 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
0
app/Models/Coupon.php
Normal file → Executable file
2
app/Models/CurrentContracts.php
Normal file → Executable file
2
app/Models/CurrentContracts.php
Normal file → Executable 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
4
app/Models/FinishedContracts.php
Normal file → Executable 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
2
app/Models/LinkedSocialAccount.php
Normal file → Executable file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LinkedSocialAccount extends Model
|
||||
|
||||
30
app/Models/NoHome.php
Normal file
30
app/Models/NoHome.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\FinishedContracts;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
|
||||
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
|
||||
|
||||
class NoHome extends Model
|
||||
{
|
||||
use HasSpatial;
|
||||
//
|
||||
|
||||
protected $fillable = [
|
||||
'contract_id',
|
||||
'house_photo',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'location' => LocationCast::class
|
||||
];
|
||||
|
||||
public function finishedcontracts()
|
||||
{
|
||||
return $this->belongsTo(FinishedContracts::class);
|
||||
}
|
||||
|
||||
}
|
||||
0
app/Models/Payments.php
Normal file → Executable file
0
app/Models/Payments.php
Normal file → Executable file
2
app/Models/Postulations.php
Normal file → Executable file
2
app/Models/Postulations.php
Normal file → Executable 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;
|
||||
|
||||
35
app/Models/Report.php
Normal file
35
app/Models/Report.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\FinishedContracts;
|
||||
use App\Models\ReportComment;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Report extends Model
|
||||
{
|
||||
//
|
||||
protected $fillable = [
|
||||
'contract_id',
|
||||
'moderator_id',
|
||||
'veredict',
|
||||
];
|
||||
|
||||
|
||||
public function finishedcontracts()
|
||||
{
|
||||
return $this->belongsTo(FinishedContracts::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'moderator_id');
|
||||
}
|
||||
|
||||
public function reportcomments()
|
||||
{
|
||||
return $this->hasMany(ReportComment::class);
|
||||
}
|
||||
}
|
||||
29
app/Models/ReportComment.php
Normal file
29
app/Models/ReportComment.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Report;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ReportComment extends Model
|
||||
{
|
||||
//
|
||||
protected $fillable = [
|
||||
'report_id',
|
||||
'user_id',
|
||||
'comment',
|
||||
];
|
||||
|
||||
public function reports()
|
||||
{
|
||||
return $this->belongsTo(Report::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
}
|
||||
19
app/Models/Role.php
Normal file
19
app/Models/Role.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Role extends Model
|
||||
{
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
];
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
}
|
||||
0
app/Models/Status.php
Normal file → Executable file
0
app/Models/Status.php
Normal file → Executable file
4
app/Models/Suppliers.php
Normal file → Executable file
4
app/Models/Suppliers.php
Normal file → Executable 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;
|
||||
|
||||
96
app/Models/User.php
Normal file
96
app/Models/User.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Role;
|
||||
use App\Models\LinkedSocialAccount;
|
||||
use App\Models\Cards;
|
||||
use App\Models\Suppliers;
|
||||
use App\Models\Postulations;
|
||||
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;
|
||||
use App\Notifications\PasswordReset;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens;
|
||||
use Notifiable;
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'profile_photo',
|
||||
'role_id',
|
||||
'social_id',
|
||||
'openpay_id',
|
||||
'password',
|
||||
'phone',
|
||||
'openpay_id',
|
||||
'phone_verified_at'
|
||||
];
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Send the password reset notification.
|
||||
*
|
||||
* @param string $token
|
||||
* @return void
|
||||
*/
|
||||
public function sendPasswordResetNotification($token)
|
||||
{
|
||||
$this->notify(new PasswordReset($token));
|
||||
}
|
||||
|
||||
public function linkedSocialAccounts()
|
||||
{
|
||||
return $this->hasMany(LinkedSocialAccount::class);
|
||||
}
|
||||
|
||||
public function cards()
|
||||
{
|
||||
return $this->hasMany(Cards::class);
|
||||
}
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->hasOne(Suppliers::class);
|
||||
}
|
||||
|
||||
public function postulations()
|
||||
{
|
||||
return $this->hasMany(Postulations::class);
|
||||
}
|
||||
|
||||
public function currentcontracts()
|
||||
{
|
||||
return $this->hasMany(CurrentContracts::class);
|
||||
}
|
||||
|
||||
public function finishedcontracts()
|
||||
{
|
||||
return $this->hasMany(FinishedContracts::class);
|
||||
}
|
||||
|
||||
public function reports()
|
||||
{
|
||||
return $this->hasMany(Report::class);
|
||||
}
|
||||
|
||||
public function reportcomments()
|
||||
{
|
||||
return $this->hasMany(ReportComment::class);
|
||||
}
|
||||
|
||||
public function roles()
|
||||
{
|
||||
return $this->belongsTo(Role::class, 'role_id');
|
||||
}
|
||||
}
|
||||
18
app/Models/Verify_accounts.php
Normal file
18
app/Models/Verify_accounts.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Verify_accounts extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'token'
|
||||
];
|
||||
protected $hidden = [
|
||||
'password',
|
||||
];
|
||||
}
|
||||
21
app/Models/iChambaParameter.php
Normal file
21
app/Models/iChambaParameter.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Suppliers;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class iChambaParameter extends Model
|
||||
{
|
||||
//
|
||||
protected $fillable = [
|
||||
'parameter',
|
||||
'num_value',
|
||||
'string_value',
|
||||
];
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->hasMany(Suppliers::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user