Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3769795
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/app/User.php b/app/User.php
index 33b528f..09a59d1 100644
--- a/app/User.php
+++ b/app/User.php
@@ -1,62 +1,69 @@
<?php namespace AuthGrove;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
use Authenticatable, CanResetPassword;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['username', 'fullname', 'email', 'password'];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
+ /**
+ * Gets fillable but not hidden attributes, plus create/update time
+ *
+ * @return Array
+ */
public function getAttributes () {
$attributes = array_diff($this->fillable , $this->hidden);
$attributes[] = 'created_at';
$attributes[] = 'updated_at';
return $attributes;
}
/**
* Gets non sensible properties
+ *
+ * @return Array
*/
public function getInformation () {
$info = [];
$attributes = $this->getAttributes();
foreach ($attributes as $attribute) {
$info[$attribute] = $this->attributes[$attribute];
}
return $info;
}
/**
* Gets the full name of an user, or if not defined, the username.
*/
public function getName () {
if ($this->attributes['fullname'] !== "") {
return $this->attributes['fullname'];
}
return $this->attributes['username'];
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 16:57 (22 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260609
Default Alt Text
(1 KB)
Attached To
Mode
rGROVE Auth Grove
Attached
Detach File
Event Timeline
Log In to Comment