Skip to content
Permalink
Browse files

Episode 32

  • Loading branch information...
JeffreyWay committed Mar 8, 2019
1 parent 7e5068b commit ff79bab570bf2cc1767fc05f58c636a7e8c5fab8
Showing with 35 additions and 1 deletion.
  1. +17 −0 app/helpers.php
  2. +3 −0 composer.json
  3. +15 −1 resources/views/projects/show.blade.php
@@ -0,0 +1,17 @@
<?php
/**
* Generate a URL to a gravatar thumbnail.
*
* @param string $email
* @return string
*/
function gravatar_url($email)
{
$email = md5($email);
return "https://gravatar.com/avatar/{$email}?" . http_build_query([
's' => 60,
'd' => 'https://s3.amazonaws.com/laracasts/images/default-square-avatar.jpg'
]);
}
@@ -39,6 +39,9 @@
"classmap": [
"database/seeds",
"database/factories"
],
"files": [
"app/helpers.php"
]
},
"autoload-dev": {
@@ -8,7 +8,21 @@
/ {{ $project->title }}
</p>

<a href="{{ $project->path().'/edit' }}" class="button">Edit Project</a>
<div class="flex items-center">
@foreach ($project->members as $member)
<img
src="{{ gravatar_url($member->email) }}"
alt="{{ $member->name }}'s avatar"
class="rounded-full w-8 mr-2">
@endforeach

<img
src="{{ gravatar_url($project->owner->email) }}"
alt="{{ $project->owner->name }}'s avatar"
class="rounded-full w-8 mr-2">

<a href="{{ $project->path().'/edit' }}" class="button ml-4">Edit Project</a>
</div>
</div>
</header>

0 comments on commit ff79bab

Please sign in to comment.
You can’t perform that action at this time.