each(function($item){ $date = self::getExplodeMessage($item); $item->from_month = $date['n']; $item->from_year = $date['Y']; $item->save(); }); dd("done"); } private static function getExplodeMessage($item){ $date = []; if(strpos($item->message, '#')){ $em = explode("#", $item->message); if(isset($em[1])){ //month $data['n'] =$em[1]; } if(isset($em[2])){ //year $data['Y'] =$em[2]; } } return $data; } public static function store() { abort(403, 'STOP funtion not online'); dd(""); } }