Laravel 4与阵列的关系

I'm trying to grab a field in a array by making a relation to the variable and i am getting the error of "Undefined property: Illuminate\Database\Eloquent\Builder::$email", Any help would be great and many thanks. my Controller is below.

else {
        $email = Input::get('email');
        $username = Input::get('Username');
        $password = Input::get('password');
        $code = str_random(60);
        $Passed = User::Insert(array(
            'email' => $email,
            'username' => $username,
            'password' => Hash::make($password),
            'code' => $code,
            'active' => 0,
            'groups' => 0
            ));

            Mail::send('emails.auth.Email',array(
                'link' => URL::route('account-activate', $code),
                'Username' => $username),
            function($message) use ($Passed) {
                $message->to($Passed->email, $Passed->username)->subject('activation');
            });
            return Redirect::route('home')->with('global', 'Hello world');      
    }
查看全部
dpnru86024
dpnru86024
2014/09/05 20:43
  • laravel
  • php
  • relationship
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复