Skip to content

Commit

Permalink
bismillah
Browse files Browse the repository at this point in the history
  • Loading branch information
emreakay committed Oct 16, 2023
1 parent e07c50a commit e13e6e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Models/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ class Connection extends Model

protected $guarded = [];

public int $from_model_id;
public string $from_model_type;

public int $to_model_id;
public string $to_model_type;

public function connectedTo(): ConnectiveContract&Model
{
return $this->to_model_type::find($this->to_model_id);
Expand Down
2 changes: 2 additions & 0 deletions tests/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,5 @@
expect($connective2->connectives()->connectives()->connectives()->connectives(modelTypes: \AuroraWebSoftware\Connective\Tests\Models\OtherConnective::class))->toHaveCount(0);

});

// connected to ve coonetedfrom testleri

0 comments on commit e13e6e0

Please sign in to comment.