Last active
February 21, 2018 11:13
-
-
Save haidarafif0809/51f6d464bb6666be2bea4a8c7a6cea65 to your computer and use it in GitHub Desktop.
Eloquent Example
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
//ini sama aja dengan "SELECT * FROM flight" | |
$flights = App\Flight::all(); | |
//ini sama aja dengan "SELECT * FROM flight WHERE id = 1" | |
$flight = App\Flight::find(1); | |
//ini sama aja dengan "SELECT * FROM flight WHERE active = 1 LIMIT 1" | |
$flight = App\Flight::where('active', 1)->first(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment