plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Bug]: Model with ULID

Open tdrabikdev opened this issue 1 year ago • 1 comments

Bug description


declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class EstimateItem extends Model
{
    use HasFactory;
    use HasUlids;
    use HasUlids;
    use HasUlids;

    protected $fillable = [
        'estimate_id',
        'company_id',
        'name',
        'quantity',
        'price',
        'total',
    ];

    public function estimate(): BelongsTo
    {
        return $this->belongsTo(Estimate::class);
    }

    public function company(): BelongsTo
    {
        return $this->belongsTo(Company::class);
    }
}

When you create new model and add some relationsips, then for each relationship is added use HasUlids; plus to modelitself.

Plugin version

8.3.3.242

Operating system

Windows

Steps to reproduce

Create new morel with some relalationships with ulid as forreign key.

Relevant log output

No response

tdrabikdev avatar Oct 07 '24 10:10 tdrabikdev

Sorry. Fixed. I hope to release the update with this fix soon.

adelf avatar Oct 10 '24 06:10 adelf