Created
December 2, 2020 23:27
-
-
Save EricMcWinNer/a9c5d249dea6477f3f34a0eae24c6767 to your computer and use it in GitHub Desktop.
Define the relationship
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
<?php | |
// app/Models/Word.php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Factories\HasFactory; | |
use Illuminate\Database\Eloquent\Model; | |
class Word extends Model | |
{ | |
use HasFactory; | |
// Define the One to One Relationship | |
public function match() { | |
return $this->hasOne(Match::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment