- Sistema de propiedades: tabla, modelo, CRUD API para que el cliente guarde direcciones nombradas - Postulacion renovada: cliente elige propiedad sin precio ni fecha, sube fotos a GCS/S3 - Proveedores ofertan date_1, date_2 y amount al postularse via pivot; sort por fecha/monto/membresia - Contratacion: selected_date recibe date_1 o date_2, amount desde pivot (depreca minimun_fee) - Cancelacion/repostulacion: archive con status=perdido, related_postulation_id para vincular - Chat en contratos activos: tabla contract_comments, controller, rutas web+API, vista panel, notificaciones bilingues - PaymentIntent calcula amount desde pivot en vez de recibirlo del front - getpendingcontracts: sin filtro de tiempo, filtra por status=active, agrega time_created - Expiracion de postulaciones reducida a 1000 min Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
102 lines
2.1 KiB
PHP
102 lines
2.1 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\Property;
|
|
use App\Models\ContractComment;
|
|
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 properties()
|
|
{
|
|
return $this->hasMany(Property::class);
|
|
}
|
|
|
|
public function contractcomments()
|
|
{
|
|
return $this->hasMany(ContractComment::class);
|
|
}
|
|
|
|
public function roles()
|
|
{
|
|
return $this->belongsTo(Role::class, 'role_id');
|
|
}
|
|
}
|