app/Http/Controllers/home/AddressController.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()
    {
        $data = session('homeuser');
        $uid = $data['id'];
        $address = Address::where('uid',$uid)->get();
        return view('home.address.address',['title'=>'收货地址列表','title1'=>'添加地址','data'=>$address,'id'=>$uid]);
    }
public function index ( ) { $ data = session ( 'homeuser' ) ; $ uid = $ data [ 'id' ] ; $ address = Address :: where ( 'uid' , $ uid ) -> get ( ) ; return view ( 'home.address.address' , [ 'title' => '收货地址列表','title1'=>' 添 加地址','da ta '=>$address,'i d '=>$ui d] ) ; }
Display a listing of the resource.
Display a listing of the resource .
//获取session中的数据 //获取当前登录用户的id // dump($address);