Lumen: Trait 'Illuminate\Foundation\Events\Dispatchable' not found
Closed this issue · 0 comments
ee01 commented
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';
}
}`