Add pivot class property (#1518)

* Add pivot class property

* Add test for pivot class properties

* Fix failed test for pivot class properties

* Update CHANGELOG.md

* Fix failed test
This commit is contained in:
dev2a
2024-03-11 14:37:15 +01:00
committed by GitHub
parent bc1d67f01c
commit ac7e186270
6 changed files with 107 additions and 0 deletions
@@ -0,0 +1,16 @@
<?php
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models;
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots\CustomPivot;
use Illuminate\Database\Eloquent\Model;
class ModelWithPivot extends Model
{
public function relationWithCustomPivot()
{
return $this->belongsToMany(ModelwithPivot::class)
->using(CustomPivot::class)
->as('customAccessor');
}
}