Looking to hire Laravel developers? Try LaraJobs

omdb-laravel maintained by rooxie

Description
A Laravel integration for OMDb API
Last update
2024/08/04 12:39 (dev-master)
License
Downloads
20

Comments
comments powered by Disqus

Laravel OMDb API Wrapper

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.