Laravel-adminlte: usermenu_image and usermenu_desc from database

Created on 23 Apr 2020  Â·  10Comments  Â·  Source: jeroennoten/Laravel-AdminLTE

how to use usermenu_image form field photo in users table, and use usermenu_desc from user role?

All 10 comments

@eraporsmk could it help you with this? https://github.com/jeroennoten/Laravel-AdminLTE/issues/542

You can extend your App\User like the code below.

class User extends Authenticatable
{
    …

    public function adminlte_image()
    {
        return $this->photo; //photo can be replaced with any other field name
    }
}

new-error

error: Using $this when not in object context (View: C:xampp\myapp\resources\views\vendor\adminlte\page.blade.php)

@eraporsmk Where you added the code?

the code
the-code

the field
the-field

@eraporsmk I have changed the readme for this error. The methods should not be a static function, so you have to change it from "public static function adminlte_image" to "public function adminlte_image". And then it works. :)

@lacodimizer Thank you very much, its work!

great!

in my case this works well on Laravel 8 and Adminlte3

Screen Shot 2020-11-18 at 17 00 25

Was this page helpful?
0 / 5 - 0 ratings

Related issues

claytongf picture claytongf  Â·  5Comments

santiagoferraz picture santiagoferraz  Â·  5Comments

fagnerfjas picture fagnerfjas  Â·  5Comments

vsilva472 picture vsilva472  Â·  4Comments

ahishamali10 picture ahishamali10  Â·  5Comments