cviebrock / eloquent-taggable

Easily add the ability to tag your Eloquent models in Laravel.
MIT License
537 stars 72 forks source link

Lumen: Trait 'Illuminate\Foundation\Events\Dispatchable' not found #132

Closed ee01 closed 7 months ago

ee01 commented 2 years ago

This is a fabulous lib. Could you did some compatible work to make it work with Lumen Framework?

Found you need import Illuminate\Foundation\Bus\Dispatchable in https://stackoverflow.com/questions/56657090/fatal-error-trait-illuminate-foundation-events-dispatchable-not-found-in-c-x

Test in Lumen 6.x, 8.x.

`class TagController extends Base { public function set($user_id, Request $request) { $this->validate($request, [ 'tags' => 'required|array', ]); if (! $user = User::find($user_id)) throw new BaseException("用户不存在!", 404);

    $user->tag($request->tags);
    return 'success';
}

}`