chivincent/laravel-user-setting

User setting for laravel 5.* with bootstrap v4.

1.0.0 2017-12-13 04:05 UTC

README

User setting view, controller and routes package, built with bootstrap v4.

Installation

composer require chivincent/laravel-user-setting --dev
php artisan vendor:publish --provider="Chivincent\UserSetting\UserSettingServiceProvider"

Usage

Create link for user setting

<div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
        @include('user-setting::components.nav-item')    
    </ul>
</div>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">

    @include('user-setting::components.dropdown-item')
    
    <a class="dropdown-item" href="{{ route('logout') }}"
       onclick="event.preventDefault();
            document.getElementById('logout-form').submit();">
        <i class="fa fa-sign-out" aria-hidden="true"></i> 登出
    </a>
    
    <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
        {{ csrf_field() }}
    </form>
</div>

Custom user table or model

Update config/user-setting.php:

<?php

return [
    'user' => [
        'table' => 'custom_users_table', 
        'model' => \YourName\User::class,
    ],
];

Screenshot

nav-item

dropdown-item

account-setting

password-setting

LICENSE

This package is under MIT license.