Files
Jobhero_back/app/Models/User.php
CarlosTorres 46469deaa8 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>
2026-01-17 22:07:34 +00:00

97 lines
2.0 KiB
PHP

<?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');
}
}