initial commit
This commit is contained in:
commit
d96b74e6c1
88 changed files with 15238 additions and 0 deletions
66
app/Http/Controllers/MovieController.php
Normal file
66
app/Http/Controllers/MovieController.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Exceptions\MovieDatabaseException;
|
||||
use App\Exceptions\MovieNotFoundException;
|
||||
use App\Interfaces\MovieDbInterface;
|
||||
use App\Models\Movie;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MovieController extends Controller
|
||||
{
|
||||
public function __construct(private MovieDbInterface $movieDb) {}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Movie $movie)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, Movie $movie)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Movie $movie)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws MovieNotFoundException
|
||||
* @throws MovieDatabaseException
|
||||
*/
|
||||
public function search(Request $request)
|
||||
{
|
||||
$searchTerm = $request->input('term');
|
||||
$movie = $this->movieDb->search($searchTerm);
|
||||
|
||||
return response()->json(['results' => $movie]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue