Skip to content

Instantly share code, notes, and snippets.

@rakeshsoni18
Last active May 29, 2020 17:22
Show Gist options
  • Save rakeshsoni18/42d2c877258f244fbea182ba23ceb061 to your computer and use it in GitHub Desktop.
Save rakeshsoni18/42d2c877258f244fbea182ba23ceb061 to your computer and use it in GitHub Desktop.
Collection Map Column Change
https://stackoverflow.com/questions/43711940/laravel-collection-using-map-and-contains
$list = collect($list)->map(function($x){
return [
'Name' => $x->fname. ' ' .$x->lname,
'Gender' => $x->gender,
'Designation' => $x->designation,
'Experience' => $x->exp_year,
'Preferred Location' => $x->preferred_location,
'Expected Salary' => $x->expected_salary,
'Resume' => $x->resume ? url('resume/'.$x->resume) : 'Not Available',
'Video Resume' => $x->resume_video_link ? 'https://www.youtube.com/watch?v=' .$x->resume_video_link : 'Not Available'
];
})->toArray();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment