Samsara SDK for Laravel

A comprehensive Laravel SDK for the Samsara Fleet Management API with fluent query builder, type-safe entities, and full API coverage.

Get Started View on GitHub


Features

  • 40+ Resource Endpoints - Full coverage of Samsara’s API including Fleet, Telematics, Safety, Dispatch, Industrial, and more
  • Fluent Query Builder - Filter, paginate, and stream data with an intuitive query interface
  • Type-Safe Entities - All API responses are mapped to strongly-typed entity classes
  • Cursor Pagination - Built-in support for Samsara’s cursor-based pagination
  • Lazy Collections - Memory-efficient streaming for large datasets
  • Testing Support - SamsaraFake class for easy mocking in tests

Quick Example

use Samsara\Facades\Samsara;

// Get all drivers
$drivers = Samsara::drivers()->all();

// Find a specific vehicle
$vehicle = Samsara::vehicles()->find('vehicle-id');

// Query with filters
$stats = Samsara::vehicleStats()
    ->current()
    ->whereVehicle(['vehicle-1', 'vehicle-2'])
    ->types(['gps', 'engineStates'])
    ->get();

Documentation

Getting Started

Guides

Resources

See the Resources section for detailed documentation on each API resource:


Requirements

  • PHP 8.1 or higher
  • Laravel 10.x, 11.x, or 12.x
  • Samsara API token

License

This package is open-sourced software licensed under the MIT license.


Back to top

Copyright © 2024-2025 Erik Galloway. Distributed under the MIT License.