0

I am using Laravel lucid framework and I have to call model setAttribute explicitly but getting below error:

ErrorException: Array to string conversion in

Code is

$user = new User;
$user->setAttribute('email',$this->email);
print_r($user);exit();

Please help

Thanks

shaedrich
  • 5,457
  • 3
  • 26
  • 42
Bhumi Shah
  • 9,323
  • 7
  • 63
  • 104

1 Answers1

1

Try to use implode() method ? :

$test = implode('', $array);

$user = new User;
$user->setAttribute('email', $test);
print_r($user);
exit();
Ben
  • 71
  • 3