ahsankhatri / wordpress-auth-driver-laravel

A package to provide wordpress users in laravel authentication system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getNameAttribute

christianschoenmakers opened this issue · comments

Add this function to the model to show the WP username in the default Auth::user()->name function.


    /**
     * Usage to return user name
     * 
     * @return string
     */
    public function getNameAttribute(){
        return $this->user_login;
    }

You can do this by extending MrShan0\WordpressAuth\Models\WordpressUser class and define your new eloquent model in config/auth.php