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.
27 lines
545 B
PHP
27 lines
545 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Sale;
|
|
use Illuminate\Http\Request;
|
|
|
|
class SaleController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
$query = Sale::with(['items.voucher', 'customer.level'])
|
|
->withCount(['items']);
|
|
|
|
return inertia('Sale/Index', [
|
|
'query' => $query->paginate(),
|
|
]);
|
|
}
|
|
|
|
public function show(Sale $sale)
|
|
{
|
|
return inertia('Sale/Detail', [
|
|
'sale' => $sale->load(['items.voucher', 'customer.level']),
|
|
]);
|
|
}
|
|
}
|