rooxie/omdb-laravel

A Laravel integration for OMDb API

0.0.1 2022-06-15 21:12 UTC

This package is auto-updated.

Last update: 2024-05-04 02:58:52 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.