Download the PHP package pvguerra/laravel-trakt without Composer
On this page you can find all versions of the php package pvguerra/laravel-trakt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pvguerra/laravel-trakt
More information about pvguerra/laravel-trakt
Files in pvguerra/laravel-trakt
Package laravel-trakt
Short Description Integrate Laravel with Trakt API
License MIT
Homepage https://github.com/pvguerra/laravel-trakt
Informations about the package laravel-trakt
Laravel Trakt
This package provides a convenient way to integrate the Trakt.tv API with your Laravel application.
The whole package was developed following the official Trakt API Documentation.
Installation
You can install the package via composer:
You can publish the config file with:
This will publish the trakt.php
config file to your config
directory:
You should add your Trakt API credentials and redirect URI to your .env
file:
If you don't have a Trakt client ID, you'll need to create a new API app.
Usage
This package provides a fluent interface to interact with the Trakt API. You can either use the Trakt
facade or dependency injection to access the client.
Most methods return a Illuminate\Http\Client\Response
object. You can call ->json()
or ->object()
on the response to get the data.
Here is a list of available classes you can use:
TraktCalendar
TraktCertification
TraktCheckIn
TraktCountry
TraktEpisode
TraktGenre
TraktLanguage
TraktList
TraktMovie
TraktNetwork
TraktPerson
TraktRecommendation
TraktSearch
TraktSeason
TraktShow
TraktSync
TraktUser
Authentication
Some endpoints require authentication. This package does not handle the OAuth2 flow for you, but it's easy to integrate with Laravel Socialite and the Trakt Socialite Provider.
Using with Laravel Socialite
Using the token
Once you have an access token, you can set it on the client:
Examples
Movies
Get a single movie:
Get popular movies:
TV Shows
Get a single show:
Get trending shows:
Search
Search for a movie, show, person, etc.
User
Get a user's profile (requires authentication):
Get a user's watched history (requires authentication):
Calendar
Get all shows airing in the next 7 days:
Quality Assurance
Testing
This package uses Pest for testing. Run the tests with:
Static Analysis
This package uses PHPStan level 5 for static code analysis. Run the analysis with:
CI/CD
This package uses GitHub Actions to run tests and static analysis on each pull request and push to the main branch. The CI pipeline ensures that:
- All tests pass
- PHPStan analysis passes with no errors
- Branch protection rules prevent merging to main if tests or analysis fail
Requirements
- PHP 8.1 or higher
- Laravel 9.0 or higher
Compatibility
Laravel | PHP |
---|---|
9.x | 8.1, 8.2 |
10.x | 8.1, 8.2, 8.3 |
Documentation
Full documentation will be available soon.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Pull requests are welcome!
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Paulo Guerra
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-trakt with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/contracts Version ^11.0||^12.0
spatie/laravel-package-tools Version ^1.16.4