form request: the request user in null

Posted 2 months ago by ederson

The task is to test form requests. In the general case it works fine.

There is a problem with one request where a custom validation rule is based on the user who made the request

In this case request()->user() is always null So far i tried 1)$this->be($user); 2)$this->actingAs($user); 3)manually login in a user

all failed.

any ideas on what i am doing wrong ?

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.