Page MenuHomeDevCentral

Identity.php
No OneTemporary

Identity.php

<?php namespace AuthGrove;
use Illuminate\Database\Eloquent\Model;
class Identity extends Model {
use FindableByAttribute;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'identities';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['uuid', 'user_id', 'username', 'fullname'];
/**
* The user linked to this identity
*
* @var User
*/
private $user;
/**
* Gets user linked to this identity
*/
public function getUser () {
if ($this->user === null) {
$this->user = User::find($this->attributes['user_id']);
}
return $this->user;
}
/**
* Gets identity name
*/
public function getName () {
if ($this->attributes['fullname'] !== "") {
return $this->attributes['fullname'];
}
return $this->attributes['username'];
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Jul 4, 03:04 (3 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3882060
Default Alt Text
Identity.php (859 B)

Event Timeline