Skip to content

Commit

Permalink
define parent() method to return the parent location
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiIsComing committed Apr 16, 2022
1 parent 97af37d commit 6a3ce27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Models/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ public function zone()
{
return $this->belongsTo(Zone::class);
}

public function parent()
{
return $this->belongsTo(Location::class, 'parent_id');
}
}

0 comments on commit 6a3ce27

Please sign in to comment.