app/Http/Controllers/guestbook.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()
    {
        $sts=Auth::user()->status;
        $id=Auth::user()->id;
        $sql=DB::table('users')->join('peminjaman','users.id','=','peminjaman.user_id')
                            ->join('peminjamandetail','peminjaman.id','=','peminjamandetail.peminjaman_id')
                            ->join('buku','peminjamandetail.buku_id','=','buku.id')
                            ->where('users.id','=',$id)
                            ->select('users.name','peminjaman.tglpinjam','peminjaman.tglhrskembali',
                                    'peminjaman.statuspinjam','buku.judul')
                            ->get();
        return view('riwayat.riwayatuser',compact('sql','sts'));
    }
public function index ( ) { $ sts = Auth :: user ( ) -> status ; $ id = Auth :: user ( ) -> id ; $ sql = DB :: table ( 'users' ) -> join ( 'peminjaman' , 'users.id' , '=' , 'peminjaman.user_id' ) -> join ( 'peminjamandetail' , 'peminjaman.id' , '=' , 'peminjamandetail.peminjaman_id' ) -> join ( 'buku' , 'peminjamandetail.buku_id' , '=' , 'buku.id' ) -> where ( 'users.id' , '=' , $ id ) -> select ( 'users.name' , 'peminjaman.tglpinjam' , 'peminjaman.tglhrskembali' , 'peminjaman.statuspinjam' , 'buku.judul' ) -> get ( ) ; return view ( 'riwayat.riwayatuser' , compact ( 'sql' , 'sts' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
//  return $sql;