Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Update README.md #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update README.md #12

wants to merge 2 commits into from

Conversation

Ryuske
Copy link

@Ryuske Ryuske commented Apr 4, 2014

Wrote an example that is an actual controller, using proper Laravel4 techniques.

Just expounded upon the previous example since I had to change it a fair bit for Laravel 4 standards

Ryuske added 2 commits April 4, 2014 13:27
Wrote an example that is an actual controller, using proper Laravel4 techniques
Added example that implements the database.
@Ryuske
Copy link
Author

Ryuske commented Apr 4, 2014

I just updated my first example to now include database implementation.

@andreascreten
Copy link
Member

Please make sure you follow PSR-2.


$name = explode(' ', $user['name']);
$email = $user['email'];
$user = User::whereRaw('first_name = ? and last_name = ? and email = ?', [$name[0], end($name), $email]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks kind of weird no ? Why not use the query builder ?

@Ryuske
Copy link
Author

Ryuske commented Apr 8, 2014

That was just left over from the way I did it. On my platform you're redirected to a different place if you are registering vs. logging in. However there is no reason it can't be firstOrCreate.

As far as using the query builder, the way I did it was just personal preference. I don't really like multi-line functions, or really long lines. So that was purely just preference.

You could change both of those things, but it doesn't really change the flow that much.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants