Download the PHP package alexoid/laravel-garmin without Composer

On this page you can find all versions of the php package alexoid/laravel-garmin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-garmin

Tests PHPStan PHP Version Latest Version Total Downloads

PHP: Garmin Connect

A comprehensive PHP API wrapper for Garmin Connect, providing access to health, fitness, and device data. Works standalone or with Laravel.

About

This library enables developers to programmatically access Garmin Connect data including:

Based on the Python garminconnect library with OAuth authentication ported from garth.

Requirements

Installation

Quick Start (Standalone)

MFA (Two-Factor Authentication)

If your account has MFA enabled, use the non-blocking mode:

Or use the blocking MfaHandler interface for CLI apps:

Quick Start (Laravel)

Publish the config:

Set environment variables:

Log in (handles MFA interactively):

Use the Facade:

Token Storage

Tokens are persisted so you don't need to re-authenticate on every request.

Store Class Use Case
File (default) FileTokenStore JSON files in ~/.garminconnect
Laravel Cache LaravelCacheTokenStore Redis, Memcached, etc.
Null NullTokenStore In-memory only, no persistence
Custom Implement TokenStoreInterface Database, S3, etc.

Examples

The examples/ directory contains working code you can run or copy into your project:

File Description
example.php Standalone CLI — run php examples/example.php for an interactive demo of login, MFA, and all major API calls
laravel-mfa-login.php Laravel controller — copy to app/Http/Controllers/, add a route, and get a two-step login endpoint with MFA support (auth state saved in session between requests)
laravel-activity-sync.php Artisan command — copy to app/Console/Commands/, run php artisan garmin:sync {user_id} to sync strength training workouts into your database (paginated fetch, exercise set parsing, incremental sync, transaction import)

Available Methods (105)

Profile (6 methods)

Method Description
getUserProfile() Get user settings
getSocialProfile() Get social profile (displayName, fullName)
getUserprofileSettings() Get profile settings
getPersonalRecord() Get personal records
requestReload(string $cdate) Request data reload for date
queryGarminGraphql(array $query) Execute GraphQL query

User Stats (10 methods)

Method Description
getUserSummary(string $cdate) Daily summary (steps, calories, distance)
getStats(string $cdate) Alias for getUserSummary
getStepsData(string $cdate) Detailed step data
getFloors(string $cdate) Floor climbing data
getDailySteps(string $start, string $end) Steps for date range
getWeeklySteps(string $end, int $weeks = 52) Weekly step aggregation
getWeeklyStress(string $end, int $weeks = 52) Weekly stress aggregation
getWeeklyIntensityMinutes(string $start, string $end) Weekly intensity minutes
getStatsAndBody(string $cdate) Combined stats + body data
getProgressSummaryBetweenDates(string $startdate, string $enddate) Progress summary

Heart Rate (3 methods)

Method Description
getHeartRates(string $cdate) Daily heart rate data
getRhrDay(string $cdate) Resting heart rate
getHrvData(string $cdate) Heart rate variability

Wellness (10 methods)

Method Description
getSleepData(string $cdate) Sleep duration, quality, score
getStressData(string $cdate) Daily stress data
getAllDayStress(string $cdate) All day stress with values array
getAllDayEvents(string $cdate) All day wellness events
getBodyBattery(string $startdate, ?string $enddate = null) Body battery levels
getBodyBatteryEvents(string $cdate) Body battery events
getRespirationData(string $cdate) Breathing rate
getSpo2Data(string $cdate) Blood oxygen saturation
getIntensityMinutesData(string $cdate) Intensity minutes
getLifestyleLoggingData(string $cdate) Lifestyle logging

Activities (10 methods)

Method Description
countActivities() Total activity count
getActivities(int $start = 0, int $limit = 20, ?string $activityType = null) List activities (paginated)
getActivitiesForDate(string $fordate) Activities for specific date
getActivitiesByDate(string $startdate, ?string $enddate = null, ?string $activityType = null, ?string $sortOrder = null) Activities in date range
getLastActivity() Most recent activity
setActivityName(string $activityId, string $title) Rename activity
setActivityType(string $activityId, int $typeId, string $typeKey, int $parentTypeId) Change activity type
getActivityTypes() Available activity types
createManualActivity(string $startDatetime, string $timeZone, string $typeKey, float $distanceKm, int $durationMin, string $activityName) Create manual activity
createManualActivityFromJson(array $payload) Create from JSON payload

Activity Details (9 methods)

Method Description
getActivity(string $activityId) Full activity data
getActivityDetails(string $activityId, int $maxChartSize = 1000, int $maxPolylineSize = 4000) Detailed metrics
getActivitySplits(string $activityId) Activity splits
getActivityTypedSplits(string $activityId) Typed splits
getActivitySplitSummaries(string $activityId) Split summaries
getActivityWeather(string $activityId) Weather during activity
getActivityHrInTimezones(string $activityId) HR in time zones
getActivityPowerInTimezones(string $activityId) Power in time zones
getActivityExerciseSets(string\|int $activityId) Exercise sets

Downloads (2 methods)

Method Description
downloadActivity(string $activityId, ActivityDownloadFormat $format = TCX) Download activity file (TCX, GPX, KML, CSV, ORIGINAL)
downloadWorkout(string\|int $workoutId) Download workout FIT file

Devices (6 methods)

Method Description
getDevices() List connected devices
getDeviceSettings(string $deviceId) Device settings
getPrimaryTrainingDevice() Primary training device
getDeviceSolarData(string $deviceSerial, string $end, int $weeks = 52) Solar charging data
getDeviceAlarms() Device alarms
getDeviceLastUsed() Last used device

Health (13 methods)

Method Description
getBodyComposition(string $startdate, ?string $enddate = null) Body composition data
getWeighIns(string $startdate, string $enddate) Weight measurements
getDailyWeighIns(string $cdate) Daily weigh-ins
addWeighIn(int\|float $weight, string $unitKey = 'kg', string $timestamp = '') Add weight entry
deleteWeighIn(string $weightPk, string $cdate) Delete weight entry
getBloodPressure(string $startdate, ?string $enddate = null) Blood pressure data
setBloodPressure(int $systolic, int $diastolic, int $pulse, string $timestamp = '', string $notes = '') Record blood pressure
deleteBloodPressure(string $version, string $cdate) Delete BP reading
getHydrationData(string $cdate) Hydration intake
addHydrationData(float $valueInMl, ?string $timestamp = null, ?string $cdate = null) Add hydration entry
getMenstrualDataForDate(string $fordate) Menstrual cycle data
getMenstrualCalendarData(string $startdate, string $enddate) Menstrual calendar
getPregnancySummary() Pregnancy summary

Metrics (7 methods)

Method Description
getMaxMetrics(string $cdate) VO2Max, fitness metrics
getLactateThreshold(bool $latest = true, ?string $startDate = null, ?string $endDate = null, string $aggregation = 'daily') Lactate threshold data
getEnduranceScore(string $cdate, int $branch = 1) Endurance score
getRacePredictions() Race predictions (latest)
getHillScore(string $cdate, int $branch = 1) Hill score
getCyclingFtp(string $activityId) Cycling FTP
getFitnessAgeData(string $cdate) Fitness age

Training (6 methods)

Method Description
getTrainingReadiness(string $cdate) Training readiness
getMorningTrainingReadiness(string $cdate) Morning readiness
getTrainingStatus(string $cdate) Training status
getTrainingPlans() All training plans
getTrainingPlanById(string\|int $planId) Specific training plan
getAdaptiveTrainingPlanById(string\|int $planId) Adaptive training plan

Badges & Challenges (8 methods)

Method Description
getEarnedBadges() Earned badges
getAvailableBadges() Available badges
getInProgressBadges() In-progress badges
getAdhocChallenges(int $start = 1, int $limit = 100) Ad-hoc challenges
getBadgeChallenges(int $start = 1, int $limit = 100) Badge challenges
getAvailableBadgeChallenges(int $start = 1, int $limit = 100) Available badge challenges
getNonCompletedBadgeChallenges(int $start = 1, int $limit = 100) Non-completed challenges
getInProgressVirtualChallenges(int $start = 1, int $limit = 100) In-progress virtual challenges

Gear (8 methods)

Method Description
getGear(string $userProfileNumber) Get all gear
getGearStats(string $gearUUID) Gear statistics
getGearDefaults(string $userProfileNumber) Default gear
setGearDefault(string $userProfileNumber, string $gearUUID, string $equipmentCategory) Set default gear
getActivityGear(string\|int $activityId) Gear used in activity
getGearActivities(string $gearUUID, int $start = 0, int $limit = 100) Activities with gear
addGearToActivity(string $activityId, string $gearUUID) Add gear to activity
removeGearFromActivity(string $activityId, string $gearUUID) Remove gear from activity

Goals (1 method)

Method Description
getGoals(string $status = 'active', int $start = 1, int $limit = 50) Goals by status (active, future, past)

Uploads (6 methods)

Method Description
uploadActivity(string $activityPath) Upload FIT/GPX/TCX activity
deleteActivity(string $activityId) Delete activity
uploadWorkout(array\|string $workoutJson) Upload workout
deleteWorkout(string\|int $workoutId) Delete workout
getWorkouts(int $start = 0, int $limit = 100) List workouts
getWorkoutById(string\|int $workoutId) Get specific workout

Testing

Development

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-endpoint)
  3. Make your changes
  4. Run tests (vendor/bin/phpunit)
  5. Submit a pull request

License

MIT License. See LICENSE for details.


All versions of laravel-garmin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
guzzlehttp/guzzle Version ^7.5
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alexoid/laravel-garmin contains the following files

Loading the files please wait ...