worked on the new onboarding steps
This commit is contained in:
@@ -3,9 +3,22 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class UserActivity extends Model
|
||||
{
|
||||
protected $guarded = array('id');
|
||||
public $table = "user_activities";
|
||||
// protected $appends = ['activity_time'];
|
||||
|
||||
public function userInfo(){
|
||||
return $this->hasOne('App\Models\StaffMember', 'id', 'user_id');
|
||||
}
|
||||
public function getActivityTimeAttribute(){
|
||||
$created = $this->created_at;
|
||||
$parsed_created_date = Carbon::parse($created);
|
||||
$current_date = Carbon::parse(date('Y-m-d'));
|
||||
$days = $parsed_created_date->diffForHumans();
|
||||
return $days;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user