- API contratos activos (cliente y proveedor): agrega campo profile_photo (técnico asignado o supplier, null si no tiene) - Notificaciones push bilingues en comentarios de reporte: "Nueva actividad en tu reporte" / "New activity on your report" - Moderador en web panel notifica a cliente y proveedor al comentar, con prefijo Moderador/Moderator - Panel usuarios: columna de foto de perfil entre ID y Nombre Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
90 lines
1.9 KiB
PHP
90 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Role;
|
|
use App\Models\LinkedSocialAccount;
|
|
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',
|
|
'stripe_customer_id',
|
|
'password',
|
|
'phone',
|
|
'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 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');
|
|
}
|
|
}
|