snipe-it/app/Http/Transformers/DatatablesTransformer.php

17 lines
355 B
PHP

<?php
namespace App\Http\Transformers;
use App\Models\Location;
class DatatablesTransformer
{
public function transformDatatables($objects, $total = null)
{
(isset($total)) ? $objects_array['total'] = $total : $objects_array['total'] = count($objects);
$objects_array['rows'] = $objects;
return $objects_array;
}
}