<?php

namespace App\Cells;

//use App\Models\Admin\ImgModel;

class Users
{
    public function __construct()
    {
        $this->ImgModel = model('App\Models\Admin\ImgModel');
    }

    public function logo(): string
    {
        $limage = base_url('satria-color.svg');
        return $limage;
    }


    public function bgprofile(): string
    {
        $limage = base_url('smart/dist/img/card-backgrounds/cover-2-lg.png');
        return $limage;
    }

    public function avatar(): string
    {
        $users = auth()->getProvider();
        $user  = $users->findById(auth()->id());

        $avatar = base_url('files/avatar/'.$user->avatar);
        
        return $avatar;
    }

    public function username(): string
    {
        $users = auth()->getProvider();
        $user  = $users->findById(auth()->id());

        return $user->username;
    }

    public function email(): string
    {
        $users = auth()->getProvider();
        $user  = $users->findById(auth()->id());

        return $user->email;
    }

    public function nipx(): string
    {
        $users = auth()->getProvider();
        $user  = $users->findById(auth()->id());

        return $user->nip;
    }

    public function last_act(): string
    {
        $users = auth()->getProvider();
        $user  = $users->findById(auth()->id());
        $last = $user->last_active;
        return dtm_indo($last);
    }
}
