mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
26 lines
538 B
PHP
26 lines
538 B
PHP
<?php
|
|
namespace App;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class DatabaseHandler
|
|
{
|
|
public function resolve(string $table, $fingerprint, array $data)
|
|
{
|
|
|
|
if (DB::table($table)->where('fingerprint', $fingerprint)) {
|
|
return DB::table($table)->get();
|
|
}
|
|
|
|
DB::table('anime')->insert($data);
|
|
}
|
|
|
|
public static function getMappedTableName(string $controller)
|
|
{
|
|
return config('controller-to-table-mapping.'.$controller);
|
|
}
|
|
|
|
public function prepare(array $response)
|
|
{
|
|
}
|
|
} |