<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Pembayaran;

use Carbon\Carbon;

use Illuminate\Support\Facades\DB ;

class laporanPengunjungController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
     
     
        $search = \Request::get('search');
        $pembayarans = Pembayaran::where('nama','like','%'.$search.'%')->orderBy('id')->paginate(10);

        $total = 0;
        $no=0;


        foreach ($pembayarans as $pembayaran) {
            $total += $no++;
        }
        
        return view('laporanPengunjung.index',['pembayarans' => $pembayarans, 'total' => $total]);
    }



    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    
}

