diff --git a/app/Models/User.php b/app/Models/User.php index 3ff7f7a6..cf09ed56 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -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 */ diff --git a/database/seeds/dev.yml b/database/seeds/dev.yml index 47492d63..dd34e51d 100644 --- a/database/seeds/dev.yml +++ b/database/seeds/dev.yml @@ -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: diff --git a/resources/views/layouts/default/home.blade.php b/resources/views/layouts/default/home.blade.php index 132a837c..7426f3b0 100644 --- a/resources/views/layouts/default/home.blade.php +++ b/resources/views/layouts/default/home.blade.php @@ -21,7 +21,7 @@
+ src="{!! $user->gravatar() !!}">