API Model updates.

This commit is contained in:
Dane Everitt
2017-02-10 17:29:10 -05:00
parent efef356870
commit 3b3002b77a
4 changed files with 56 additions and 10 deletions

View File

@@ -48,4 +48,14 @@ class APIKey extends Model
* @var array
*/
protected $guarded = ['id', 'created_at', 'updated_at'];
/**
* Gets the permissions associated with a key.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function permissions()
{
return $this->hasMany(APIPermission::class, 'key_id');
}
}