Edit File: FriendReportService.php
<?php namespace App\Services\Entity; use App\Models\FriendReport; class FriendReportService extends BaseService { /** * Initializes the FriendReportService class. * * @param FriendReport $friendReport The report model instance. */ public function __construct(FriendReport $friendReport) { $this->model = $friendReport; } public function index($id = null) { if (request()->ajax()) { $friendreports = FriendReport::with(['user:id,first_name,last_name' , 'reportable:id,first_name,last_name']) ->search(request('searchArray')) ->reorder('created_at' , 'desc') ->paginate(30); $html = view('admin.friendreports.table', compact('friendreports'))->render(); return response()->json(['html' => $html]); } return view('admin.friendreports.index'); } }
Back to File Manager