Skip to content

Instantly share code, notes, and snippets.

@JeffreyWay
Created May 29, 2013 21:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffreyWay/5674014 to your computer and use it in GitHub Desktop.
Save JeffreyWay/5674014 to your computer and use it in GitHub Desktop.
<?php
class User extends Eloquent {
public function getOldest()
{
return $this->orderBy('age', 'desc')->first();
}
}
@vladan-zoricic
Copy link

Some combination of 2 and 3.

@JulienItard
Copy link

2

@jlambe
Copy link

jlambe commented May 30, 2013

2 because we're dealing with datas from the database. Otherwise 3 if you intend to test a method that format a given data.

@lnguyen0901
Copy link

2 and 3

@hasokeric
Copy link

2

@torkiljohnsen
Copy link

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