5a46c85533
this shit is very broken right now.
49 lines
967 B
PHP
Executable File
49 lines
967 B
PHP
Executable File
<?php
|
|
|
|
use Cartalyst\Sentry\Users\Eloquent\User as SentryUserModel;
|
|
|
|
class User extends SentryUserModel {
|
|
|
|
/**
|
|
* Indicates if the model should soft delete.
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $softDelete = true;
|
|
|
|
/**
|
|
* Returns the user full name, it simply concatenates
|
|
* the user first and last name.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function fullName()
|
|
{
|
|
return "{$this->first_name} {$this->last_name}";
|
|
}
|
|
|
|
/**
|
|
* Returns the user Gravatar image url.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function gravatar()
|
|
{
|
|
// Generate the Gravatar hash
|
|
$gravatar = md5(strtolower(trim($this->gravatar)));
|
|
|
|
// Return the Gravatar url
|
|
return "//gravatar.org/avatar/{$gravatar}";
|
|
}
|
|
|
|
public function numassets()
|
|
{
|
|
|
|
$assetcount = DB::table('users')
|
|
->join('contacts', 'users.id', '=', 'contacts.user_id')
|
|
->join('orders', 'users.id', '=', 'orders.user_id')
|
|
->select('users.id', 'contacts.phone', 'orders.price');
|
|
}
|
|
|
|
}
|