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');
}