Created
December 1, 2022 11:15
-
-
Save OMGZui/24c4ba00fe93c2003554d5854fcd1653 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Factory.php | |
class Factory extends Model | |
{ | |
public function workers() | |
{ | |
return $this->hasMany(Worker::class); | |
} | |
} | |
// Worker.php | |
class Worker extends Model | |
{ | |
public function factory() | |
{ | |
return $this->belongsTo(Factory::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment