koel/app/Http/Controllers/API/FetchDemoCreditsController.php

20 lines
429 B
PHP
Raw Normal View History

2022-08-04 08:34:13 +00:00
<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\File;
2022-08-04 08:34:13 +00:00
use Throwable;
class FetchDemoCreditsController extends Controller
2022-08-04 08:34:13 +00:00
{
public function __invoke()
2022-08-04 08:34:13 +00:00
{
try {
return response()->json(json_decode(File::get(resource_path('demo-credits.json')), true));
2022-08-04 08:34:13 +00:00
} catch (Throwable) {
return response()->json();
2022-08-04 08:34:13 +00:00
}
}
}