jikan-rest/app/GenreAnime.php
Irfan d20d0ef5da add Anime/Manga Advanced Search
Pagination, Limit
Order By + Sort
Query
Letter
2020-07-10 20:58:07 +05:00

54 lines
942 B
PHP

<?php
namespace App;
use Jenssegers\Mongodb\Eloquent\Model;
use Jikan\Request\Genre\AnimeGenresRequest;
/**
* Class Magazine
* @package App
*/
class GenreAnime extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'mal_id', 'name', 'url', 'count'
];
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'genres_anime';
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
'_id', 'expiresAt'
];
/**
* @return array
*/
public static function scrape() : array
{
$data = app('JikanParser')->getAnimeGenres(new AnimeGenresRequest());
return json_decode(
app('SerializerV4')
->serialize($data, 'json'),
true
);
}
}