themosis / framework

The Themosis framework core.

Home Page:https://framework.themosis.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trait 'Themosis\Core\Events\Dispatchable' not found

havasjeancarlostrabajo opened this issue · comments

  • Themosis Version: 2.0
  • WordPress Version: 6.1
  • PHP Version: 7.4

Description

The error happens when firing an event in laravel

Steps to reproduce

To reproduce the error I have the following event class

`<?php

namespace App\Events;

use Illuminate\Support\Facades\Log;
use App\Traits\TraitDataNotifications;
use Illuminate\Queue\SerializesModels;
use Themosis\Core\Events\Dispatchable;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\InteractsWithSockets;

class EventHabilitarSerie
{
use Dispatchable, InteractsWithSockets, SerializesModels , TraitDataNotifications;

/**
 * Create a new event instance.
 *
 * @return void
 */
public function __construct()
{
}



/**
 * Get the channels the event should broadcast on.
 *
 * @return \Illuminate\Broadcasting\Channel|array
 */
public function broadcastOn()
{
    return new PrivateChannel('channel-name');
}

}`

where I fire the event as follows

event( new EventHabilitarSerie() );

Expected behavior

That the event fires, I don't understand why it fails

solution is

use Themosis\Core\Bus\Dispatchable;