I have this code
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
use Stevebauman\Location\Drivers\Driver;
use Stevebauman\Location\Exceptions\DriverDoesNotExistException;
Class CRUD extends Eloquent {
protected $collection;
public function __construct($collection ,array $attributes = array())
{
parent::__construct($attributes);
$this->collection = $collection;
}
}
when I am using this code in order to call the constructor , I get nothings $device_mode=new CRUD('HW101950054393'); because as I noticed when I trying to echo the $collection variable inside the constructor I get this error
Array to string conversion
I don't understand that as I am passing the variable as string but the model working with it as array. why is that happening, and how can I solve it