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

33 lines
666 B
PHP
Raw Normal View History

2018-06-04 01:39:38 +00:00
<?php
namespace App\Http\Controllers;
use Auth;
use App\Like;
use Illuminate\Http\Request;
class ApiController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function hydrateLikes(Request $request)
{
$this->validate($request, [
'min' => 'nullable|integer|min:1',
'max' => 'nullable|integer',
]);
$profile = Auth::user()->profile;
$likes = Like::whereProfileId($profile->id)
->orderBy('id', 'desc')
->take(1000)
2018-06-04 01:39:38 +00:00
->pluck('status_id');
2018-06-04 01:39:38 +00:00
return response()->json($likes);
}
}