themosis / framework

The Themosis framework core.
https://framework.themosis.com/
GNU General Public License v2.0
670 stars 121 forks source link

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

Closed ghost closed 1 year ago

ghost commented 1 year ago

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

ghost commented 1 year ago

solution is

use Themosis\Core\Bus\Dispatchable;