Writing test is tricky sometimes, one of the feature I like from laravel is is integration with unit test with run smoothly. ok lets pretend we have this code in our Controller We want to test if event App\Events\Member\Created is triggered or not in that Controller so here I wrote the test: You may see this is already documented in laravel docs it self. but I want to highlight on this part: Why we need to specify this? Image, Your Member’s model is using `traits` who requires auth()->user()->id which means this will need to use even-listener of Eloquent for example: so thats answer, by implementing instead of at the top, you will get auth()->user()value exists, otherwise it will benull