Created
September 10, 2020 23:37
-
-
Save EricMcWinNer/4aa4b8acf2bf67acf3b28ee90edc650c 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
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
class User extends Model | |
{ | |
/** | |
* Get's this user's vote | |
*/ | |
public function vote() | |
{ | |
return $this->hasOne(App\Models\Vote::class, 'foreign_key', 'local_key'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment