update
This commit is contained in:
@@ -18,7 +18,7 @@ class WebDesignQuoteController extends Controller
|
||||
{
|
||||
$perPage = min((int) $request->get('per_page', 15), 100);
|
||||
|
||||
$query = WebDesignQuote::with('creator:id,name')
|
||||
$query = WebDesignQuote::with('creator:id,firstname,lastname')
|
||||
->when($request->get('filter'), fn($q, $f) =>
|
||||
$q->where(fn($sub) => $sub
|
||||
->where('quote_number', 'like', "%{$f}%")
|
||||
@@ -47,7 +47,7 @@ class WebDesignQuoteController extends Controller
|
||||
|
||||
public function show(int $id): JsonResponse
|
||||
{
|
||||
$quote = WebDesignQuote::with('creator:id,name')->find($id);
|
||||
$quote = WebDesignQuote::with('creator:id,firstname,lastname')->find($id);
|
||||
|
||||
if (!$quote) {
|
||||
return response()->json(['error' => true, 'message' => 'Không tìm thấy báo giá.'], 404);
|
||||
@@ -92,7 +92,7 @@ class WebDesignQuoteController extends Controller
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => 'Cập nhật báo giá thành công.',
|
||||
'data' => $quote->fresh('creator:id,name'),
|
||||
'data' => $quote->fresh('creator:id,firstname,lastname'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user