Question: I'm trying to compare dates from database (firebase) with NOW. I'm using moment.js and it's not working. I think it has something to do with the time zone (or UTC+01:00)...

Example.

* date1: "2016-11-20T14:00:00"
* NOW: "2016-11-20T14:49:20+01:00"

I get NOW with `moment()` and compare like this:

```
var date1 = moment("2016-11-20T14:00:00");
moment(date1).isSameOrAfter( moment() ) // returns true

```

The comparison is precisely one hour off... How can I fix this? AND: is there any best practice in storing and comparing dates across time zones.

Answer: 
Get the data using [eager loading](https://laravel.com/docs/5.3/eloquent-relationships#eager-loading):

```
$user = User::where('id', $userId)->with('roles')->first();

```

Then display the data:

```
{{-- Display full name --}}
{{ $user->first_name.' '.$user->last_name }}

{{-- Display all role names of the user --}}
@foreach ($user->roles as $role)
    {{ $role->name }}
@endforeach

```

I guess relation here is many to many, so you need to change `roles()` relation to `belongsToMany()`

If you're using some package with many to many relationship, but you're only attach one role for user, you can display role name with this:

```
{{ $user->roles->first()->name }}

```

Also, you could use [accessor](https://laravel.com/docs/5.3/eloquent-mutators#accessors-and-mutators) to get full name:

```
public function getFullNameAttribute($value)
{
    return $this->first_name.' '.$this->last_name;
}

```

To display full name using accessor:

```
{{ $user->full_name }}

```
```
@foreach($users as $user)
{{$user->name}}  {{$user->roles->first()->name}}

@endforeach

```