1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-29 11:15:09 +00:00
pixelfed/app/Http/Controllers/ApiController.php

41 lines
1.2 KiB
PHP
Raw Normal View History

2018-06-04 01:39:38 +00:00
<?php
namespace App\Http\Controllers;
2018-08-10 05:04:21 +00:00
use App\Http\Controllers\Api\BaseApiController;
2018-08-28 03:07:36 +00:00
use App\Like;
use Auth;
use Cache;
use Illuminate\Http\Request;
2018-06-04 01:39:38 +00:00
2018-08-10 05:04:21 +00:00
class ApiController extends BaseApiController
2018-06-04 01:39:38 +00:00
{
2019-02-25 18:56:24 +00:00
// todo: deprecate and remove
2018-06-04 01:39:38 +00:00
public function hydrateLikes(Request $request)
{
2019-03-25 03:34:25 +00:00
return response()->json([]);
}
2018-06-04 01:39:38 +00:00
2019-03-25 03:34:25 +00:00
public function siteConfiguration(Request $request)
{
$res = Cache::remember('api:site:configuration', now()->addMinutes(30), function() {
return [
'uploader' => [
'max_photo_size' => config('pixelfed.max_photo_size'),
'max_caption_length' => config('pixelfed.max_caption_length'),
'album_limit' => config('pixelfed.max_album_length'),
'image_quality' => config('pixelfed.image_quality'),
'optimize_image' => config('pixelfed.optimize_image'),
'optimize_video' => config('pixelfed.optimize_video'),
2019-03-25 03:34:25 +00:00
'media_types' => config('pixelfed.media_types'),
'enforce_account_limit' => config('pixelfed.enforce_account_limit')
]
];
});
2018-08-10 05:04:21 +00:00
return response()->json($res);
}
2018-06-04 01:39:38 +00:00
}