some sample users and gravatar lookup

This commit is contained in:
Nabeel Shahzad 2017-08-10 18:21:24 -05:00
parent 1a532a9082
commit f46f87567c
3 changed files with 37 additions and 1 deletions

View File

@ -86,6 +86,14 @@ class User extends Authenticatable
return $this->airline->code.str_pad($this->id, 3, '0', STR_PAD_LEFT);
}
public function gravatar()
{
$size = 80;
$default = 'https://en.gravatar.com/userimage/12856995/7c7c1da6387853fea65ff74983055386.png';
return "https://www.gravatar.com/avatar/" .
md5( strtolower( trim( $this->email) ) ) . "?d=" . urlencode( $default ) . "&s=" . $size;
}
/**
* Foreign Keys
*/

View File

@ -20,12 +20,40 @@ users:
flight_time: 43200
created_at: now
updated_at: now
- id: 2
name: Carla Walters
email: carla.walters68@example.com
password: admin
rank_id: 1
airline_id: 1
home_airport_id: 2
curr_airport_id: 2
flights: 1
flight_time: 43200
created_at: now
updated_at: now
- id: 3
name: Raymond Pearson
email: raymond.pearson56@example.com
password: admin
rank_id: 1
airline_id: 1
home_airport_id: 2
curr_airport_id: 2
flights: 1
flight_time: 43200
created_at: now
updated_at: now
role_user:
- user_id: 1
role_id: 1
- user_id: 1
role_id: 2
- user_id: 2
role_id: 2
- user_id: 3
role_id: 2
# ranks
ranks:

View File

@ -21,7 +21,7 @@
</h3>
<div class="photo-container">
<img class="rounded-circle"
src="https://en.gravatar.com/userimage/12856995/7c7c1da6387853fea65ff74983055386.png">
src="{!! $user->gravatar() !!}">
</div>
</div>
<div class="content content-center">