Extend customers' information.
This commit is contained in:
@@ -23,6 +23,14 @@ class CustomerController extends Controller
|
||||
return view('customer.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Customer $customer): View
|
||||
{
|
||||
return view('customer.show', ['customer' => $customer->load(['addresses', 'invoices'])]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
|
||||
@@ -92,4 +92,12 @@ class Customer extends Model
|
||||
{
|
||||
return $this->hasMany(Address::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all customer's invoices.
|
||||
*/
|
||||
public function invoices(): HasMany
|
||||
{
|
||||
return $this->hasMany(Invoice::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user