bagisto / laravel-data-faker

Creates fake data of products and customers for testing
MIT License
22 stars 23 forks source link

Error to create faker data #35

Closed jeann2013 closed 8 months ago

jeann2013 commented 8 months ago

In Faker.php line 26:
syntax error, unexpected 'protected' (T_PROTECTED), expecting variable (T_VARIABLE)

Screenshot 2024-01-01 050902

devansh-webkul commented 8 months ago

Issue fixed in master.

hagarwal-velsof commented 7 months ago

I am still facing this issue. Can you please suggest what exactly was fixed here?

jeann2013 commented 7 months ago

I am still facing this issue. Can you please suggest what exactly was fixed here?

Me too

hagarwal-velsof commented 7 months ago

I have fixed it by updating the faker.php as -

<?php

namespace Webkul\Faker\Jobs;

use Illuminate\Bus\Batchable;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Webkul\Faker\Helpers\Faker as FakerHelper;

class Faker implements ShouldQueue
{
    use Batchable, Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $entity;
    protected $count;
    protected $productType;

    /**
     * Create a new job instance.
     *
     * @param  string  $entity
     * @param  int  $count
     * @param  string  $productType
     * @return void
     */
    public function __construct($entity, $count, $productType) {
        $this->entity = $entity;
        $this->count = $count;
        $this->productType = $productType;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        app(FakerHelper::class)->fake(
            $this->entity,
            $this->count,
            $this->productType
        );
    }
}
jeann2013 commented 7 months ago

I downloaded this change and same error