Skip to content

Instantly share code, notes, and snippets.

@EricMcWinNer
Created September 11, 2020 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EricMcWinNer/1e8a2469540d84d358b3f204a5c9b78a to your computer and use it in GitHub Desktop.
Save EricMcWinNer/1e8a2469540d84d358b3f204a5c9b78a to your computer and use it in GitHub Desktop.
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Vote extends Model {
/**
* Get's this vote's user
*/
public function user() {
return $this->belongsTo(App\Models\User::class, 'foreign_key', 'local_key');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment