PHP code example of luisozparr / adminlte_users

1. Go to this page and download the library: Download luisozparr/adminlte_users library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

luisozparr / adminlte_users example snippets

 artisan migrate
 artisan vendor:publish
config/app.php:
app\http\Kernel.php

public function rol(){
    return $this->belongsTo('Ozparr\AdminlteUsers\Models\Rol');
}

public function getImgAttribute($value)
{
    return 'storage/img/users/' . $value;
}

/**
 * @var array $roles
 * @return bool
 */
public function areRol($roles){
    foreach ($roles as $rol){
        if($this->rol->nombre == $rol ){
            return true;
        }
    }
    return false;
}

php artisan db:seed --class="\Ozparr\AdminlteUsers\DataBase\Seeds\DatabaseSeeder"

php artisan storage:link
app\Http\Middleware\RedirectIfAuthenticated.php