mirror of https://github.com/pixelfed/pixelfed
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			33 lines
		
	
	
		
			666 B
		
	
	
	
		
			PHP
		
	
			
		
		
	
	
			33 lines
		
	
	
		
			666 B
		
	
	
	
		
			PHP
		
	
<?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)
 | 
						|
                 ->pluck('status_id');
 | 
						|
 | 
						|
        return response()->json($likes);
 | 
						|
    }
 | 
						|
}
 |