Created
March 6, 2017 15:54
-
-
Save dsomel21/ab908be6abf41ae6d74d2d69a09a3d46 to your computer and use it in GitHub Desktop.
Params vs. no params
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> $artist->fresh()->albums()->first(); | |
string(46) "select * from "artists" where "id" = ? limit 1" | |
string(98) "select * from "albums" where "albums"."artist_id" = ? and "albums"."artist_id" is not null limit 1" | |
=> App\Album {#668 | |
id: "1", | |
artist_id: "2", | |
album_name: "Yeezus", | |
created_at: "2017-03-06 15:22:37", | |
updated_at: "2017-03-06 15:22:37", | |
} | |
>>> $artist->fresh()->albums->first(); | |
string(46) "select * from "artists" where "id" = ? limit 1" | |
string(90) "select * from "albums" where "albums"."artist_id" = ? and "albums"."artist_id" is not null" | |
=> App\Album {#658 | |
id: "1", | |
artist_id: "2", | |
album_name: "Yeezus", | |
created_at: "2017-03-06 15:22:37", | |
updated_at: "2017-03-06 15:22:37", | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment