Created
March 15, 2018 00:53
-
-
Save wichaksono/24c46597d470c1e8794eceb87cb0dbf8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
use Illuminate\Database\Eloquent\Model; | |
class Role extends Model | |
{ | |
public $timestamps = false; | |
protected $fillable = [ | |
'role_name', 'created_at', 'updated_at' | |
]; | |
/* | |
* Method untuk yang mendefinisikan relasi antara model user dan model Role | |
*/ | |
public function getUserObject() | |
{ | |
return $this->belongsToMany(User::class)->using(UserRole::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment