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,12 +6,16 @@ use Inertia\Inertia;
class TenantController extends Controller
{
public function index()
{
$tenants = Tenant::latest()->paginate(15);
return Inertia::render('Tenants/Index', ['tenants' => $tenants]);
}
public function index(Request $request)
{
$tenants = Tenant::when($request->search, fn($q) =>
$q->where('name', 'like', "%{$request->search}%")
->orWhere('phone', 'like', "%{$request->search}%")
)
->latest()
->paginate(15);
return Inertia::render('Tenants/Index', ['tenants' => $tenants]);
}
public function create()
{
return Inertia::render('Tenants/Create');