Fix: socket permissions para nginx
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Promocion extends Model
|
||||
{
|
||||
protected $table = 'promociones';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'fecha_inicio' => 'date',
|
||||
'fecha_fin' => 'date',
|
||||
];
|
||||
|
||||
public function planteles(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Plantel::class, 'plantel_promocion');
|
||||
}
|
||||
|
||||
public function alumnos(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Alumno::class, 'alumno_promocion')
|
||||
->withPivot(['enviado_at', 'status_envio', 'whatsapp_mensaje_id']);
|
||||
}
|
||||
|
||||
public function isActiva(): bool
|
||||
{
|
||||
return $this->status === 'activo';
|
||||
}
|
||||
|
||||
public function imagenUrl(): ?string
|
||||
{
|
||||
return $this->imagen ? asset('storage/' . $this->imagen) : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user