PHP code example of khant-nyar / tmdb_wrapper
1. Go to this page and download the library: Download khant-nyar/tmdb_wrapper library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
khant-nyar / tmdb_wrapper example snippets
public function fetchMovies(Request $request)
{
$searchKey = $request->input('search_key', 'Man of Steel');
$movies = TmdbService::fetchMovies($searchKey);
dd($movies);
return response()->json(['movies' => $movies]);
}
public function fetchTVSeries(Request $request)
{
$searchKey = $request->input('search_key', 'Super Natural');
$tvSeries = TmdbService::fetchTVSeries($searchKey);
return response()->json(['tv_series' => $tvSeries]);
}
public function fetchMovieDetails(){
$id = 49521;
$details = TmdbService::fetchMovieDetails($id);
return response()->json($details);
}
public function fetchTVSerieDetails(){
$id = 157202;
$details = TmdbService::fetchTVSerieDetails($id);
return response()->json($details);
}
bash
php artisan vendor:publish --provider="KhantNyar\TmdbWrapper\TmdbWrapperServiceProvider"