Created
November 25, 2020 00:57
-
-
Save EricMcWinNer/1d05c7546b94129be156a6457d439966 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 | |
use App\Models\User; | |
class RandomClass { | |
public function randomFunction(){ | |
$user = User::find(1); // Gets a User Instance | |
$vote = $user->vote->politicalParty; // Gets the party the user voted for | |
// Do whatever with it | |
print_r($vote); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment