这个错误是什么以及如何捕捉它?
Cannot access protected property Illuminate\Database\MySqlConnection::$pdo
这是我的代码:
if($user->save())
{
try
{
DB::connection()->pdo->beginTransaction();
Mymodel::insert('credit-card',array('user_id'=>$user->id,'card_holder'=>Input::get('custname')));
Mymodel::insert('billing-info',array('user_id'=>$user->id,'name'=>Input::get('custname')));
DB::connection()->pdo->commit();
Auth::login( $user );
return Redirect::to( 'profile' );
}
catch (\PDOException $e)
{
$user->delete();
DB::connection()->pdo->rollBack();
return 'ERROR: Something went wrong. Please try again later';
}
}