mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
* Created a positiblity to add custom relation type * Changed access modifier Co-authored-by: Markus Podar <[email protected]> * fixed hints from code review * Added Test for https://github.com/barryvdh/laravel-ide-helper/pull/987 * composer fix-style * Clarify doc in config entry * Update CHANGELOG.md Co-authored-by: Markus Podar <[email protected]>
24 lines
728 B
PHP
24 lines
728 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Traits;
|
|
|
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Types\SampleToManyRelationType;
|
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Types\SampleToOneRelationType;
|
|
|
|
trait HasTestRelations
|
|
{
|
|
public function testToOneRelation($related)
|
|
{
|
|
$instance = $this->newRelatedInstance($related);
|
|
return new SampleToOneRelationType($instance->newQuery(), $this);
|
|
}
|
|
|
|
public function testToManyRelation($related)
|
|
{
|
|
$instance = $this->newRelatedInstance($related);
|
|
return new SampleToManyRelationType($instance->newQuery(), $this);
|
|
}
|
|
}
|