app/Http/Controllers/PenjualanController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $user = Auth::user();
        $penjualan = Penjualan::orderBy('id', 'DESC')->where('dibayar', null)->first();
        if (!$penjualan) {
            $detail_penjualans = [];
            return view('kasir.penjualan.index', compact('user', 'detail_penjualans'));
        }
        $detail_penjualans = DetailPenjualan::where('penjualan_id', $penjualan->id)->get();
        return view('kasir.penjualan.index', compact('user', 'detail_penjualans'));
    }
public function index ( ) { $ user = Auth :: user ( ) ; $ penjualan = Penjualan :: orderBy ( 'id' , 'DESC' ) -> where ( 'dibayar' , null ) -> first ( ) ; if ( ! $ penjualan ) { $ detail_penjualans = [ ] ; return view ( 'kasir.penjualan.index' , compact ( 'user' , 'detail_penjualans' ) ) ; } $ detail_penjualans = DetailPenjualan :: where ( 'penjualan_id' , $ penjualan -> id ) -> get ( ) ; return view ( 'kasir.penjualan.index' , compact ( 'user' , 'detail_penjualans' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .