rooxie / omdb-laravel
A Laravel integration for OMDb API
0.0.1
2022-06-15 21:12 UTC
Requires
- php: >=7.2
- illuminate/support: ^6|^7|^8|^9
- rooxie/omdb: ^0.4.0
This package is auto-updated.
Last update: 2024-11-04 11:12:00 UTC
README
Introduction
A Laravel integration of PHP wrapper for OMDb API.
Installation
Install omdb-laravel
using Composer.
composer require rooxie/omdb-laravel
Quickstart
Add OMDb API key to your .env
file
OMDB_API_KEY=xxxxxxx
Use OMDb as a facade
use Rooxie\Laravel\Facades\OMDb; OMDb::getByImdbId('tt0110912'); OMDb::getByTitle('harry potter', 'movie', 2004); OMDb::search('arrival', 'movie', 2016, 1);
Use from Laravel Service Container
use Rooxie\OMDb; class UserController extends Controller { public function show(OMDb $omdb, string $imdbId) { return view('user.profile', [ 'movie' => $omdb->getByImdbId($imdbId), ]); } }
Documentation
Read the full documentation here.