public function anakAll()
 {
     return Anak::all()->toJson();
 }
Esempio n. 2
0
 /**
  *
  * @param string $start example 1998-12-25
  * @param string $end example 1999-12-25
  * @return boolean | Anak
  */
 public static function getAnakBetween($start = null, $end = null)
 {
     if (!is_null($start)) {
         if (!is_null($end)) {
             $start = date("Y-m-d", strtotime($start));
             $end = date("Y-m-d", strtotime($end));
             return Anak::where('created_at', '>=', $start)->where('created_at', '<=', $end)->get();
         } else {
             return false;
         }
     } else {
         return Anak::all();
     }
 }