Skip to content

Return $this from login() to allow for chaining#38

Open
grantholle wants to merge 1 commit intocodecasts:developfrom
grantholle:master
Open

Return $this from login() to allow for chaining#38
grantholle wants to merge 1 commit intocodecasts:developfrom
grantholle:master

Conversation

@grantholle
Copy link
Copy Markdown

I find myself wanting to do $auth->login($user)->issue() instead of multiple lines

@hernandev
Copy link
Copy Markdown
Member

@grantholle even though I agree that would be a single line beauty, the login method on other guard drivers don't behave like this.

I guess they return either the user or boolean.

The token issue is the second step, for an already authenticated user.

Since it does not affect very much other stuff, I'll merge it, but I'll keep it open for a while to include this on a next release, to avoid breaking BC.

Thank you!

@hernandev hernandev changed the base branch from master to develop August 26, 2018 03:43
@hernandev
Copy link
Copy Markdown
Member

Also, changed the target branch to develop. master is release only. Thanks

@jakewtaylor
Copy link
Copy Markdown

jakewtaylor commented Mar 7, 2019

Could you not just use the tap() helper method?

tap($auth)->login($user)->issue();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants