mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
add Producer Controller
This commit is contained in:
parent
7f13bd1013
commit
eda9fa326b
14
app/Http/Controllers/ProducerController.php
Normal file
14
app/Http/Controllers/ProducerController.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Jikan\Request\Producer\ProducerRequest;
|
||||
|
||||
class ProducerController extends Controller
|
||||
{
|
||||
public function main(int $id, int $page = 1)
|
||||
{
|
||||
$producer = $this->jikan->getProducer(new ProducerRequest($id, $page));
|
||||
return response($this->serializer->serialize($producer, 'json'));
|
||||
}
|
||||
}
|
@ -195,6 +195,10 @@ $router->group(
|
||||
'uses' => 'ScheduleController@main'
|
||||
]);
|
||||
|
||||
$router->get('producer/{id:[0-9]+}[/{page:[0-9]+}]', [
|
||||
'uses' => 'ProducerController@main'
|
||||
]);
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user