renew and other crud functionality

This commit is contained in:
2026-01-11 18:31:03 +00:00
parent 55bf184d53
commit ca516d74c2
21 changed files with 882 additions and 74 deletions

View File

@@ -6,11 +6,16 @@ use Inertia\Inertia;
class OwnerController extends Controller
{
public function index()
{
$owners = Owner::latest()->paginate(15);
return Inertia::render('Owners/Index', ['owners' => $owners]);
}
public function index(Request $request)
{
$owners = Owner::when($request->search, fn($q) =>
$q->where('name', 'like', "%{$request->search}%")
->orWhere('phone', 'like', "%{$request->search}%")
)
->latest()
->paginate(15);
return Inertia::render('Owners/Index', ['owners' => $owners]);
}
public function create()
{