Ahora si :)))))))))))))))))
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PushSubscription extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'id_usuario',
|
||||
'tipo_usuario',
|
||||
'endpoint',
|
||||
'p256dh',
|
||||
'auth',
|
||||
];
|
||||
|
||||
/**
|
||||
* Relación polimórfica manual (ya que no usamos el User estándar de Laravel siempre)
|
||||
*/
|
||||
public function scopeParaUsuario($query, $tipo, $id)
|
||||
{
|
||||
return $query->where('tipo_usuario', $tipo)->where('id_usuario', $id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user