Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

218
Views
Comportamiento extraño con las notificaciones de Laravel Slack

Así que estoy configurando un controlador de excepciones que envía una notificación de Slack cada vez que ocurre una excepción en la aplicación, también configuré esto cuando se crea una Queja (Modelo) y funciona bien. Pero en mi Exception/Handle.php tengo esta configuración.

 Notification::route('slack', env('LOG_SLACK_WEBHOOK_URL'))->notify(new ExceptionCreated($exception));

El webhook existe y funciona. Y mientras dd () cada paso posible, sé que golpea la excepción creada en las notificaciones. Así que ahí tengo este código.

 namespace App\Notifications; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Notification; use Illuminate\Notifications\Messages\SlackMessage; use Carbon\Carbon; use Throwable; use Auth; use Illuminate\Support\Facades\Request; class ExceptionCreated extends Notification { use Queueable; /** * @var Throwable */ public $exception; /** * Create a new notification instance. * * @param \Throwable $exception * @return void */ public function __construct(Throwable $exception) { $this->exception = $exception; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return ['slack']; } /** * Get the slack representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\SlackMessage */ public function toSlack($notifiable) { dd($this->exception); //and a lot of code here but that doesn't matter }

Ahora, cuando vuelco dentro del constructor, puedo ver que la excepción se pasa correctamente, pero nunca activa la función toSlack y no tengo idea de por qué, borré el caché, volqué la carga automática y nada parece estar funcionando, como dije. este código exacto para mis quejas y funciona bien. Así que cualquier sugerencia es muy apreciada.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!