mirror of
https://gitlab.com/omair-personal/izyim.git
synced 2026-08-19 04:14:05 +00:00
20 lines
479 B
PHP
Executable File
20 lines
479 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Classes\ControllersLogic\Contacts;
|
|
|
|
use App\Models\Contact;
|
|
use App\Http\Resources\Contact as ContactResource;
|
|
|
|
class ListContacts
|
|
{
|
|
public function execute(int $type, string $reference) {
|
|
|
|
// Get contacts
|
|
$contacts = Contact::where('type', $type)->where('reference_id', $reference)->orderBy('created_at')->paginate(5);
|
|
|
|
// Return collection of contacts as a resource
|
|
return ContactResource::collection($contacts);
|
|
|
|
}
|
|
}
|