app/Http/Controllers/home/AddressController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create()
    {
        $data = session('homeuser');
        $uid = $data['id'];
        $address = Address::where('uid',$uid)->get();
        return view('home.address.addresscreate',['title'=>'收货地址列表','title1'=>'添加地址','data'=>$address,'id'=>$uid]);
    }
public function create ( ) { $ data = session ( 'homeuser' ) ; $ uid = $ data [ 'id' ] ; $ address = Address :: where ( 'uid' , $ uid ) -> get ( ) ; return view ( 'home.address.addresscreate' , [ 'title' => '收货地址列表','title1'=>' 添 加地址','da ta '=>$address,'i d '=>$ui d] ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .
//获取session中的数据 //获取当前登录用户的id