Skip to content

Instantly share code, notes, and snippets.

@saeedsajadi
Created September 2, 2017 14:09
Show Gist options
  • Save saeedsajadi/031a8a0d43aa542ef7dd40bc49921196 to your computer and use it in GitHub Desktop.
Save saeedsajadi/031a8a0d43aa542ef7dd40bc49921196 to your computer and use it in GitHub Desktop.
public static function getStudentsArray()
{
$students = Student::get();
$students->each(function ($model) {
$model->setAppends(['numerator_full_name']);
});
$students = $students->pluck('numerator_full_name', 'id')->toArray();
return $students;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment