|UserDevice newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|UserDevice newQuery() * @method static \Illuminate\Database\Eloquent\Builder|UserDevice query() * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereFingerprint($value) * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereIp($value) * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereLastActiveAt($value) * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereTrusted($value) * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereUserAgent($value) * @method static \Illuminate\Database\Eloquent\Builder|UserDevice whereUserId($value) * @mixin \Eloquent */ class UserDevice extends Model { protected $guarded = []; public $timestamps = [ 'last_active_at', ]; public function user() { return $this->belongsTo(User::class); } public function getUserAgent() { if (! $this->user_agent) { return 'Unknown'; } return new UserAgentService($this->user_agent); } }