Download the PHP package zero-to-prod/omdb without Composer
On this page you can find all versions of the php package zero-to-prod/omdb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zero-to-prod/omdb
More information about zero-to-prod/omdb
Files in zero-to-prod/omdb
Package omdb
Short Description A PHP wrapper for the OMDb API with full object support
License MIT
Homepage https://github.com/zero-to-prod/omdb
Informations about the package omdb
Zerotoprod\Omdb
Contents
- Introduction
- TLDR
- Requirements
- Getting an OMDb API Key
- Installation
- Usage
- poster()
- byIdOrTitle()
- search()
- Factories
- Mocking
- Local Development
- Contributing
Introduction
Zerotoprod\OmdbApi
is a PHP cURL wrapper for the OMDb API with full object support.
It allows you to search for movies, series, and other media, retrieve detailed information using IMDb IDs or titles, and fetch poster images.
It wraps the OmdbApi and returns fully hydrated models using the OmdbModels package.
TLDR
Requirements
- PHP 8.1 or higher.
- cURL extension enabled (typically enabled by default in most PHP installations).
- A valid OMDb API key. A free key is typically available.
Getting an OMDb API Key
- Go to the OMDb API website.
- Sign up for a free or paid plan depending on your usage requirements.
- After registering, you will receive an API Key that you must pass to the OmdbApi class during initialization.
Installation
Install Zerotoprod\Omdb
via Composer:
This will add the package to your project’s dependencies and create an autoloader entry for it.
Usage
Initialization:
You can also customize the base URL and the poster URL if you need to (for example, to proxy through another service):
poster()
Get the poster art of a title by its ImdbID
byIdOrTitle()
Find a title by ImdbID (Internet Movie DataBase ID) or title.
Returns a Title DataModel.
search()
Find multiple titles. Note the imdbID
value is used as the key for each movie.
Returns a SearchResults DataModel.
Factories
You can use the provided factories without going through the api like this:
Mocking
You can mock the api by implementing the Zerotoprod\OmdbApi\OmdbApiInterface:
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
All versions of omdb with dependencies
zero-to-prod/omdb-api Version ^1.0.1
zero-to-prod/omdb-models Version ^1.0
ext-curl Version *