Fix: socket permissions para nginx
This commit is contained in:
@@ -5,11 +5,17 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Alumno extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'opt_out' => 'boolean',
|
||||
'opt_out_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function existe($plantelId): bool
|
||||
{
|
||||
return $this->plantelUsuarios()
|
||||
@@ -52,4 +58,21 @@ class Alumno extends Model
|
||||
return $this->hasMany(Documento::class);
|
||||
}
|
||||
|
||||
public function promociones(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Promocion::class, 'alumno_promocion')
|
||||
->withPivot(['enviado_at', 'status_envio', 'whatsapp_mensaje_id']);
|
||||
}
|
||||
|
||||
public function whatsappLogs(): HasMany
|
||||
{
|
||||
return $this->hasMany(WhatsappLog::class);
|
||||
}
|
||||
|
||||
public function telefonoWhatsapp(): ?string
|
||||
{
|
||||
$user = $this->alumnos()->first();
|
||||
return $user?->telefono;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user