Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Astrotomic/opendor.me

79 stars
1 code files
View Astrotomic/opendor.me on GitHub

app/Jobs/UpdateUserDetails.php

Open in GitHub
use App\Models\User;
 
class UpdateUserDetails extends GithubJob
{
//
public function run(): void
{
$data = $this->user->github()->get("/users/{$this->user->name}")->json();
 
$this->user->update([
'full_name' => $data['name'],
'description' => $data['bio'],
'twitter' => $data['twitter_username'],
'website' => $data['blog'],
'location' => $data['location'],
]);
 
if (! $this->user->hasGithubToken()) {
return;
}
 
$emails = $this->user->github()->get('/user/emails')->collect()
->filter->verified
->pluck('email')
->unique()
->toArray();
 
$this->user->update(['emails' => $emails]);
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.