Optimise invoice data requests #56
This commit is contained in:
@@ -2,12 +2,20 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Inertia\Inertia;
|
||||
use App\Models\Customer;
|
||||
use App\Support\ApiDataTransformer;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
|
||||
public function show()
|
||||
{
|
||||
return Inertia::render('Customers', [
|
||||
'customersData' => $this->index()
|
||||
]);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$customers = Customer::with(['contacts' => function ($query) {
|
||||
|
||||
Reference in New Issue
Block a user