Skip to content

->BulkSave throwing an error in Tinker #135

@dingman

Description

@dingman

Hi! TIA for such a GREAT package, I greatly appreciate it.

I'm having an issue when working through the documentation.

>>> Plastic::persist()->bulkSave(Product::all())
[!] Aliasing 'Product' to 'App\Product' for this Tinker session.
TypeError: Argument 1 passed to Sleimanx2\Plastic\Connection::__construct() must be of the type array, null given, called in /home/vagrant/code/vendor/sleimanx2/plastic/src
/PlasticManager.php on line 37
>>> Plastic::persist()->bulkSave(Product::find(1))
TypeError: Argument 1 passed to Sleimanx2\Plastic\Connection::__construct() must be of the type array, null given, called in /home/vagrant/code/vendor/sleimanx2/plastic/src
/PlasticManager.php on line 37
>>> Plastic::persist()->bulkSave(\App\Product::find(1))
TypeError: Argument 1 passed to Sleimanx2\Plastic\Connection::__construct() must be of the type array, null given, called in /home/vagrant/code/vendor/sleimanx2/plastic/src
/PlasticManager.php on line 37

Any suggestions to what I'm doing wrong?

I have this in my Product model:

...
use Illuminate\Database\Eloquent\Model;
use Cviebrock\EloquentSluggable\Sluggable;
use Sleimanx2\Plastic\Searchable;

class Product extends Model
{

    protected $table = 'products';
    protected $type = 'product';
    protected $dates = ['updated_at'];

    use Searchable;
    public $searchable = ['title','sku'];
    public $documentIndex = 'tracker';
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions