Create routes and views for customers and their addresses.

This commit is contained in:
2024-12-10 21:09:12 +01:00
parent 9d2eddbcf1
commit 679a067506
16 changed files with 797 additions and 3 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Http\Controllers;
use App\Models\Customer;
use Illuminate\Contracts\View\View;
class CustomerController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(): View
{
return view('customer.index');
}
/**
* Show the form for creating a new resource.
*/
public function create(): View
{
return view('customer.create');
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Customer $customer): View
{
return view('customer.edit', ['customer' => $customer->load(['addresses'])]);
}
}